proteus  1.7.2
C/C++/Fortran libraries
csmoothers.c
Go to the documentation of this file.
1 /* Generated by Cython 0.28.5 */
2 
3 #define PY_SSIZE_T_CLEAN
4 #include "Python.h"
5 #ifndef Py_PYTHON_H
6  #error Python headers needed to compile C extensions, please install development version of Python.
7 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
8  #error Cython requires Python 2.6+ or Python 3.3+.
9 #else
10 #define CYTHON_ABI "0_28_5"
11 #define CYTHON_FUTURE_DIVISION 0
12 #include <stddef.h>
13 #ifndef offsetof
14  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
15 #endif
16 #if !defined(WIN32) && !defined(MS_WINDOWS)
17  #ifndef __stdcall
18  #define __stdcall
19  #endif
20  #ifndef __cdecl
21  #define __cdecl
22  #endif
23  #ifndef __fastcall
24  #define __fastcall
25  #endif
26 #endif
27 #ifndef DL_IMPORT
28  #define DL_IMPORT(t) t
29 #endif
30 #ifndef DL_EXPORT
31  #define DL_EXPORT(t) t
32 #endif
33 #define __PYX_COMMA ,
34 #ifndef HAVE_LONG_LONG
35  #if PY_VERSION_HEX >= 0x02070000
36  #define HAVE_LONG_LONG
37  #endif
38 #endif
39 #ifndef PY_LONG_LONG
40  #define PY_LONG_LONG LONG_LONG
41 #endif
42 #ifndef Py_HUGE_VAL
43  #define Py_HUGE_VAL HUGE_VAL
44 #endif
45 #ifdef PYPY_VERSION
46  #define CYTHON_COMPILING_IN_PYPY 1
47  #define CYTHON_COMPILING_IN_PYSTON 0
48  #define CYTHON_COMPILING_IN_CPYTHON 0
49  #undef CYTHON_USE_TYPE_SLOTS
50  #define CYTHON_USE_TYPE_SLOTS 0
51  #undef CYTHON_USE_PYTYPE_LOOKUP
52  #define CYTHON_USE_PYTYPE_LOOKUP 0
53  #if PY_VERSION_HEX < 0x03050000
54  #undef CYTHON_USE_ASYNC_SLOTS
55  #define CYTHON_USE_ASYNC_SLOTS 0
56  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
57  #define CYTHON_USE_ASYNC_SLOTS 1
58  #endif
59  #undef CYTHON_USE_PYLIST_INTERNALS
60  #define CYTHON_USE_PYLIST_INTERNALS 0
61  #undef CYTHON_USE_UNICODE_INTERNALS
62  #define CYTHON_USE_UNICODE_INTERNALS 0
63  #undef CYTHON_USE_UNICODE_WRITER
64  #define CYTHON_USE_UNICODE_WRITER 0
65  #undef CYTHON_USE_PYLONG_INTERNALS
66  #define CYTHON_USE_PYLONG_INTERNALS 0
67  #undef CYTHON_AVOID_BORROWED_REFS
68  #define CYTHON_AVOID_BORROWED_REFS 1
69  #undef CYTHON_ASSUME_SAFE_MACROS
70  #define CYTHON_ASSUME_SAFE_MACROS 0
71  #undef CYTHON_UNPACK_METHODS
72  #define CYTHON_UNPACK_METHODS 0
73  #undef CYTHON_FAST_THREAD_STATE
74  #define CYTHON_FAST_THREAD_STATE 0
75  #undef CYTHON_FAST_PYCALL
76  #define CYTHON_FAST_PYCALL 0
77  #undef CYTHON_PEP489_MULTI_PHASE_INIT
78  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
79  #undef CYTHON_USE_TP_FINALIZE
80  #define CYTHON_USE_TP_FINALIZE 0
81 #elif defined(PYSTON_VERSION)
82  #define CYTHON_COMPILING_IN_PYPY 0
83  #define CYTHON_COMPILING_IN_PYSTON 1
84  #define CYTHON_COMPILING_IN_CPYTHON 0
85  #ifndef CYTHON_USE_TYPE_SLOTS
86  #define CYTHON_USE_TYPE_SLOTS 1
87  #endif
88  #undef CYTHON_USE_PYTYPE_LOOKUP
89  #define CYTHON_USE_PYTYPE_LOOKUP 0
90  #undef CYTHON_USE_ASYNC_SLOTS
91  #define CYTHON_USE_ASYNC_SLOTS 0
92  #undef CYTHON_USE_PYLIST_INTERNALS
93  #define CYTHON_USE_PYLIST_INTERNALS 0
94  #ifndef CYTHON_USE_UNICODE_INTERNALS
95  #define CYTHON_USE_UNICODE_INTERNALS 1
96  #endif
97  #undef CYTHON_USE_UNICODE_WRITER
98  #define CYTHON_USE_UNICODE_WRITER 0
99  #undef CYTHON_USE_PYLONG_INTERNALS
100  #define CYTHON_USE_PYLONG_INTERNALS 0
101  #ifndef CYTHON_AVOID_BORROWED_REFS
102  #define CYTHON_AVOID_BORROWED_REFS 0
103  #endif
104  #ifndef CYTHON_ASSUME_SAFE_MACROS
105  #define CYTHON_ASSUME_SAFE_MACROS 1
106  #endif
107  #ifndef CYTHON_UNPACK_METHODS
108  #define CYTHON_UNPACK_METHODS 1
109  #endif
110  #undef CYTHON_FAST_THREAD_STATE
111  #define CYTHON_FAST_THREAD_STATE 0
112  #undef CYTHON_FAST_PYCALL
113  #define CYTHON_FAST_PYCALL 0
114  #undef CYTHON_PEP489_MULTI_PHASE_INIT
115  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
116  #undef CYTHON_USE_TP_FINALIZE
117  #define CYTHON_USE_TP_FINALIZE 0
118 #else
119  #define CYTHON_COMPILING_IN_PYPY 0
120  #define CYTHON_COMPILING_IN_PYSTON 0
121  #define CYTHON_COMPILING_IN_CPYTHON 1
122  #ifndef CYTHON_USE_TYPE_SLOTS
123  #define CYTHON_USE_TYPE_SLOTS 1
124  #endif
125  #if PY_VERSION_HEX < 0x02070000
126  #undef CYTHON_USE_PYTYPE_LOOKUP
127  #define CYTHON_USE_PYTYPE_LOOKUP 0
128  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
129  #define CYTHON_USE_PYTYPE_LOOKUP 1
130  #endif
131  #if PY_MAJOR_VERSION < 3
132  #undef CYTHON_USE_ASYNC_SLOTS
133  #define CYTHON_USE_ASYNC_SLOTS 0
134  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
135  #define CYTHON_USE_ASYNC_SLOTS 1
136  #endif
137  #if PY_VERSION_HEX < 0x02070000
138  #undef CYTHON_USE_PYLONG_INTERNALS
139  #define CYTHON_USE_PYLONG_INTERNALS 0
140  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
141  #define CYTHON_USE_PYLONG_INTERNALS 1
142  #endif
143  #ifndef CYTHON_USE_PYLIST_INTERNALS
144  #define CYTHON_USE_PYLIST_INTERNALS 1
145  #endif
146  #ifndef CYTHON_USE_UNICODE_INTERNALS
147  #define CYTHON_USE_UNICODE_INTERNALS 1
148  #endif
149  #if PY_VERSION_HEX < 0x030300F0
150  #undef CYTHON_USE_UNICODE_WRITER
151  #define CYTHON_USE_UNICODE_WRITER 0
152  #elif !defined(CYTHON_USE_UNICODE_WRITER)
153  #define CYTHON_USE_UNICODE_WRITER 1
154  #endif
155  #ifndef CYTHON_AVOID_BORROWED_REFS
156  #define CYTHON_AVOID_BORROWED_REFS 0
157  #endif
158  #ifndef CYTHON_ASSUME_SAFE_MACROS
159  #define CYTHON_ASSUME_SAFE_MACROS 1
160  #endif
161  #ifndef CYTHON_UNPACK_METHODS
162  #define CYTHON_UNPACK_METHODS 1
163  #endif
164  #ifndef CYTHON_FAST_THREAD_STATE
165  #define CYTHON_FAST_THREAD_STATE 1
166  #endif
167  #ifndef CYTHON_FAST_PYCALL
168  #define CYTHON_FAST_PYCALL 1
169  #endif
170  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
171  #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000)
172  #endif
173  #ifndef CYTHON_USE_TP_FINALIZE
174  #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
175  #endif
176 #endif
177 #if !defined(CYTHON_FAST_PYCCALL)
178 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
179 #endif
180 #if CYTHON_USE_PYLONG_INTERNALS
181  #include "longintrepr.h"
182  #undef SHIFT
183  #undef BASE
184  #undef MASK
185 #endif
186 #ifndef __has_attribute
187  #define __has_attribute(x) 0
188 #endif
189 #ifndef __has_cpp_attribute
190  #define __has_cpp_attribute(x) 0
191 #endif
192 #ifndef CYTHON_RESTRICT
193  #if defined(__GNUC__)
194  #define CYTHON_RESTRICT __restrict__
195  #elif defined(_MSC_VER) && _MSC_VER >= 1400
196  #define CYTHON_RESTRICT __restrict
197  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
198  #define CYTHON_RESTRICT restrict
199  #else
200  #define CYTHON_RESTRICT
201  #endif
202 #endif
203 #ifndef CYTHON_UNUSED
204 # if defined(__GNUC__)
205 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
206 # define CYTHON_UNUSED __attribute__ ((__unused__))
207 # else
208 # define CYTHON_UNUSED
209 # endif
210 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
211 # define CYTHON_UNUSED __attribute__ ((__unused__))
212 # else
213 # define CYTHON_UNUSED
214 # endif
215 #endif
216 #ifndef CYTHON_MAYBE_UNUSED_VAR
217 # if defined(__cplusplus)
218  template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
219 # else
220 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
221 # endif
222 #endif
223 #ifndef CYTHON_NCP_UNUSED
224 # if CYTHON_COMPILING_IN_CPYTHON
225 # define CYTHON_NCP_UNUSED
226 # else
227 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
228 # endif
229 #endif
230 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
231 #ifdef _MSC_VER
232  #ifndef _MSC_STDINT_H_
233  #if _MSC_VER < 1300
234  typedef unsigned char uint8_t;
235  typedef unsigned int uint32_t;
236  #else
237  typedef unsigned __int8 uint8_t;
238  typedef unsigned __int32 uint32_t;
239  #endif
240  #endif
241 #else
242  #include <stdint.h>
243 #endif
244 #ifndef CYTHON_FALLTHROUGH
245  #if defined(__cplusplus) && __cplusplus >= 201103L
246  #if __has_cpp_attribute(fallthrough)
247  #define CYTHON_FALLTHROUGH [[fallthrough]]
248  #elif __has_cpp_attribute(clang::fallthrough)
249  #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
250  #elif __has_cpp_attribute(gnu::fallthrough)
251  #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
252  #endif
253  #endif
254  #ifndef CYTHON_FALLTHROUGH
255  #if __has_attribute(fallthrough)
256  #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
257  #else
258  #define CYTHON_FALLTHROUGH
259  #endif
260  #endif
261  #if defined(__clang__ ) && defined(__apple_build_version__)
262  #if __apple_build_version__ < 7000000
263  #undef CYTHON_FALLTHROUGH
264  #define CYTHON_FALLTHROUGH
265  #endif
266  #endif
267 #endif
268 
269 #ifndef CYTHON_INLINE
270  #if defined(__clang__)
271  #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
272  #elif defined(__GNUC__)
273  #define CYTHON_INLINE __inline__
274  #elif defined(_MSC_VER)
275  #define CYTHON_INLINE __inline
276  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
277  #define CYTHON_INLINE inline
278  #else
279  #define CYTHON_INLINE
280  #endif
281 #endif
282 
283 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
284  #define Py_OptimizeFlag 0
285 #endif
286 #define __PYX_BUILD_PY_SSIZE_T "n"
287 #define CYTHON_FORMAT_SSIZE_T "z"
288 #if PY_MAJOR_VERSION < 3
289  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
290  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
291  PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
292  #define __Pyx_DefaultClassType PyClass_Type
293 #else
294  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
295  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
296  PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
297  #define __Pyx_DefaultClassType PyType_Type
298 #endif
299 #ifndef Py_TPFLAGS_CHECKTYPES
300  #define Py_TPFLAGS_CHECKTYPES 0
301 #endif
302 #ifndef Py_TPFLAGS_HAVE_INDEX
303  #define Py_TPFLAGS_HAVE_INDEX 0
304 #endif
305 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
306  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
307 #endif
308 #ifndef Py_TPFLAGS_HAVE_FINALIZE
309  #define Py_TPFLAGS_HAVE_FINALIZE 0
310 #endif
311 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
312  #ifndef METH_FASTCALL
313  #define METH_FASTCALL 0x80
314  #endif
315  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
316  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
317  Py_ssize_t nargs, PyObject *kwnames);
318 #else
319  #define __Pyx_PyCFunctionFast _PyCFunctionFast
320  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
321 #endif
322 #if CYTHON_FAST_PYCCALL
323 #define __Pyx_PyFastCFunction_Check(func)\
324  ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)))))
325 #else
326 #define __Pyx_PyFastCFunction_Check(func) 0
327 #endif
328 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
329  #define PyObject_Malloc(s) PyMem_Malloc(s)
330  #define PyObject_Free(p) PyMem_Free(p)
331  #define PyObject_Realloc(p) PyMem_Realloc(p)
332 #endif
333 #if CYTHON_COMPILING_IN_PYSTON
334  #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
335  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
336 #else
337  #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
338  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
339 #endif
340 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
341  #define __Pyx_PyThreadState_Current PyThreadState_GET()
342 #elif PY_VERSION_HEX >= 0x03060000
343  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
344 #elif PY_VERSION_HEX >= 0x03000000
345  #define __Pyx_PyThreadState_Current PyThreadState_GET()
346 #else
347  #define __Pyx_PyThreadState_Current _PyThreadState_Current
348 #endif
349 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
350 #include "pythread.h"
351 #define Py_tss_NEEDS_INIT 0
352 typedef int Py_tss_t;
353 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
354  *key = PyThread_create_key();
355  return 0; // PyThread_create_key reports success always
356 }
357 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
358  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
359  *key = Py_tss_NEEDS_INIT;
360  return key;
361 }
362 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
363  PyObject_Free(key);
364 }
365 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
366  return *key != Py_tss_NEEDS_INIT;
367 }
368 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
369  PyThread_delete_key(*key);
370  *key = Py_tss_NEEDS_INIT;
371 }
372 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
373  return PyThread_set_key_value(*key, value);
374 }
375 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
376  return PyThread_get_key_value(*key);
377 }
378 #endif // TSS (Thread Specific Storage) API
379 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
380 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
381 #else
382 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
383 #endif
384 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
385  #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
386  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
387 #else
388  #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
389  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
390 #endif
391 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
392 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
393 #else
394 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
395 #endif
396 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
397  #define CYTHON_PEP393_ENABLED 1
398  #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
399  0 : _PyUnicode_Ready((PyObject *)(op)))
400  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
401  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
402  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
403  #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
404  #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
405  #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
406  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
407  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
408 #else
409  #define CYTHON_PEP393_ENABLED 0
410  #define PyUnicode_1BYTE_KIND 1
411  #define PyUnicode_2BYTE_KIND 2
412  #define PyUnicode_4BYTE_KIND 4
413  #define __Pyx_PyUnicode_READY(op) (0)
414  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
415  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
416  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
417  #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
418  #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
419  #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
420  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
421  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
422 #endif
423 #if CYTHON_COMPILING_IN_PYPY
424  #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
425  #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
426 #else
427  #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
428  #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
429  PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
430 #endif
431 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
432  #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
433 #endif
434 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
435  #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
436 #endif
437 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
438  #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
439 #endif
440 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
441 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
442 #if PY_MAJOR_VERSION >= 3
443  #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
444 #else
445  #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
446 #endif
447 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
448  #define PyObject_ASCII(o) PyObject_Repr(o)
449 #endif
450 #if PY_MAJOR_VERSION >= 3
451  #define PyBaseString_Type PyUnicode_Type
452  #define PyStringObject PyUnicodeObject
453  #define PyString_Type PyUnicode_Type
454  #define PyString_Check PyUnicode_Check
455  #define PyString_CheckExact PyUnicode_CheckExact
456  #define PyObject_Unicode PyObject_Str
457 #endif
458 #if PY_MAJOR_VERSION >= 3
459  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
460  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
461 #else
462  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
463  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
464 #endif
465 #ifndef PySet_CheckExact
466  #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
467 #endif
468 #if CYTHON_ASSUME_SAFE_MACROS
469  #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
470 #else
471  #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
472 #endif
473 #if PY_MAJOR_VERSION >= 3
474  #define PyIntObject PyLongObject
475  #define PyInt_Type PyLong_Type
476  #define PyInt_Check(op) PyLong_Check(op)
477  #define PyInt_CheckExact(op) PyLong_CheckExact(op)
478  #define PyInt_FromString PyLong_FromString
479  #define PyInt_FromUnicode PyLong_FromUnicode
480  #define PyInt_FromLong PyLong_FromLong
481  #define PyInt_FromSize_t PyLong_FromSize_t
482  #define PyInt_FromSsize_t PyLong_FromSsize_t
483  #define PyInt_AsLong PyLong_AsLong
484  #define PyInt_AS_LONG PyLong_AS_LONG
485  #define PyInt_AsSsize_t PyLong_AsSsize_t
486  #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
487  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
488  #define PyNumber_Int PyNumber_Long
489 #endif
490 #if PY_MAJOR_VERSION >= 3
491  #define PyBoolObject PyLongObject
492 #endif
493 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
494  #ifndef PyUnicode_InternFromString
495  #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
496  #endif
497 #endif
498 #if PY_VERSION_HEX < 0x030200A4
499  typedef long Py_hash_t;
500  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
501  #define __Pyx_PyInt_AsHash_t PyInt_AsLong
502 #else
503  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
504  #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
505 #endif
506 #if PY_MAJOR_VERSION >= 3
507  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
508 #else
509  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
510 #endif
511 #if CYTHON_USE_ASYNC_SLOTS
512  #if PY_VERSION_HEX >= 0x030500B1
513  #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
514  #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
515  #else
516  #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
517  #endif
518 #else
519  #define __Pyx_PyType_AsAsync(obj) NULL
520 #endif
521 #ifndef __Pyx_PyAsyncMethodsStruct
522  typedef struct {
523  unaryfunc am_await;
524  unaryfunc am_aiter;
525  unaryfunc am_anext;
526  } __Pyx_PyAsyncMethodsStruct;
527 #endif
528 
529 #if defined(WIN32) || defined(MS_WINDOWS)
530  #define _USE_MATH_DEFINES
531 #endif
532 #include <math.h>
533 #ifdef NAN
534 #define __PYX_NAN() ((float) NAN)
535 #else
536 static CYTHON_INLINE float __PYX_NAN() {
537  float value;
538  memset(&value, 0xFF, sizeof(value));
539  return value;
540 }
541 #endif
542 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
543 #define __Pyx_truncl trunc
544 #else
545 #define __Pyx_truncl truncl
546 #endif
547 
548 
549 #define __PYX_ERR(f_index, lineno, Ln_error) \
550 { \
551  __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
552 }
553 
554 #ifndef __PYX_EXTERN_C
555  #ifdef __cplusplus
556  #define __PYX_EXTERN_C extern "C"
557  #else
558  #define __PYX_EXTERN_C extern
559  #endif
560 #endif
561 
562 #define __PYX_HAVE__csmoothers
563 #define __PYX_HAVE_API__csmoothers
564 /* Early includes */
565 #include <string.h>
566 #include <stdio.h>
567 #include "numpy/arrayobject.h"
568 #include "numpy/ufuncobject.h"
569 #include "proteus_superlu.h"
570 #include "smoothers.h"
571 #include "pythread.h"
572 #include <stdlib.h>
573 #include "pystate.h"
574 #ifdef _OPENMP
575 #include <omp.h>
576 #endif /* _OPENMP */
577 
578 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
579 #define CYTHON_WITHOUT_ASSERTIONS
580 #endif
581 
582 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
583  const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
584 
585 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
586 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
587 #define __PYX_DEFAULT_STRING_ENCODING ""
588 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
589 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
590 #define __Pyx_uchar_cast(c) ((unsigned char)c)
591 #define __Pyx_long_cast(x) ((long)x)
592 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
593  (sizeof(type) < sizeof(Py_ssize_t)) ||\
594  (sizeof(type) > sizeof(Py_ssize_t) &&\
595  likely(v < (type)PY_SSIZE_T_MAX ||\
596  v == (type)PY_SSIZE_T_MAX) &&\
597  (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
598  v == (type)PY_SSIZE_T_MIN))) ||\
599  (sizeof(type) == sizeof(Py_ssize_t) &&\
600  (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
601  v == (type)PY_SSIZE_T_MAX))) )
602 #if defined (__cplusplus) && __cplusplus >= 201103L
603  #include <cstdlib>
604  #define __Pyx_sst_abs(value) std::abs(value)
605 #elif SIZEOF_INT >= SIZEOF_SIZE_T
606  #define __Pyx_sst_abs(value) abs(value)
607 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
608  #define __Pyx_sst_abs(value) labs(value)
609 #elif defined (_MSC_VER)
610  #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
611 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
612  #define __Pyx_sst_abs(value) llabs(value)
613 #elif defined (__GNUC__)
614  #define __Pyx_sst_abs(value) __builtin_llabs(value)
615 #else
616  #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
617 #endif
618 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
619 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
620 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
621 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
622 #define __Pyx_PyBytes_FromString PyBytes_FromString
623 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
624 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
625 #if PY_MAJOR_VERSION < 3
626  #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
627  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
628 #else
629  #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
630  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
631 #endif
632 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
633 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
634 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
635 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
636 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
637 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
638 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
639 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
640 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
641 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
642 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
643 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
644 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
645 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
646 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
647 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
648 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
649  const Py_UNICODE *u_end = u;
650  while (*u_end++) ;
651  return (size_t)(u_end - u - 1);
652 }
653 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
654 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
655 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
656 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
657 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
658 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
659 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
660 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
661 #define __Pyx_PySequence_Tuple(obj)\
662  (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
663 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
664 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
665 #if CYTHON_ASSUME_SAFE_MACROS
666 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
667 #else
668 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
669 #endif
670 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
671 #if PY_MAJOR_VERSION >= 3
672 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
673 #else
674 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
675 #endif
676 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
677 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
678 static int __Pyx_sys_getdefaultencoding_not_ascii;
679 static int __Pyx_init_sys_getdefaultencoding_params(void) {
680  PyObject* sys;
681  PyObject* default_encoding = NULL;
682  PyObject* ascii_chars_u = NULL;
683  PyObject* ascii_chars_b = NULL;
684  const char* default_encoding_c;
685  sys = PyImport_ImportModule("sys");
686  if (!sys) goto bad;
687  default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
688  Py_DECREF(sys);
689  if (!default_encoding) goto bad;
690  default_encoding_c = PyBytes_AsString(default_encoding);
691  if (!default_encoding_c) goto bad;
692  if (strcmp(default_encoding_c, "ascii") == 0) {
693  __Pyx_sys_getdefaultencoding_not_ascii = 0;
694  } else {
695  char ascii_chars[128];
696  int c;
697  for (c = 0; c < 128; c++) {
698  ascii_chars[c] = c;
699  }
700  __Pyx_sys_getdefaultencoding_not_ascii = 1;
701  ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
702  if (!ascii_chars_u) goto bad;
703  ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
704  if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
705  PyErr_Format(
706  PyExc_ValueError,
707  "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
708  default_encoding_c);
709  goto bad;
710  }
711  Py_DECREF(ascii_chars_u);
712  Py_DECREF(ascii_chars_b);
713  }
714  Py_DECREF(default_encoding);
715  return 0;
716 bad:
717  Py_XDECREF(default_encoding);
718  Py_XDECREF(ascii_chars_u);
719  Py_XDECREF(ascii_chars_b);
720  return -1;
721 }
722 #endif
723 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
724 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
725 #else
726 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
727 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
728 static char* __PYX_DEFAULT_STRING_ENCODING;
729 static int __Pyx_init_sys_getdefaultencoding_params(void) {
730  PyObject* sys;
731  PyObject* default_encoding = NULL;
732  char* default_encoding_c;
733  sys = PyImport_ImportModule("sys");
734  if (!sys) goto bad;
735  default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
736  Py_DECREF(sys);
737  if (!default_encoding) goto bad;
738  default_encoding_c = PyBytes_AsString(default_encoding);
739  if (!default_encoding_c) goto bad;
740  __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
741  if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
742  strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
743  Py_DECREF(default_encoding);
744  return 0;
745 bad:
746  Py_XDECREF(default_encoding);
747  return -1;
748 }
749 #endif
750 #endif
751 
752 
753 /* Test for GCC > 2.95 */
754 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
755  #define likely(x) __builtin_expect(!!(x), 1)
756  #define unlikely(x) __builtin_expect(!!(x), 0)
757 #else /* !__GNUC__ or GCC < 2.95 */
758  #define likely(x) (x)
759  #define unlikely(x) (x)
760 #endif /* __GNUC__ */
761 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
762 
763 static PyObject *__pyx_m = NULL;
764 static PyObject *__pyx_d;
765 static PyObject *__pyx_b;
766 static PyObject *__pyx_cython_runtime = NULL;
767 static PyObject *__pyx_empty_tuple;
768 static PyObject *__pyx_empty_bytes;
769 static PyObject *__pyx_empty_unicode;
770 static int __pyx_lineno;
771 static int __pyx_clineno = 0;
772 static const char * __pyx_cfilenm= __FILE__;
773 static const char *__pyx_filename;
774 
775 /* Header.proto */
776 #if !defined(CYTHON_CCOMPLEX)
777  #if defined(__cplusplus)
778  #define CYTHON_CCOMPLEX 1
779  #elif defined(_Complex_I)
780  #define CYTHON_CCOMPLEX 1
781  #else
782  #define CYTHON_CCOMPLEX 0
783  #endif
784 #endif
785 #if CYTHON_CCOMPLEX
786  #ifdef __cplusplus
787  #include <complex>
788  #else
789  #include <complex.h>
790  #endif
791 #endif
792 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
793  #undef _Complex_I
794  #define _Complex_I 1.0fj
795 #endif
796 
797 
798 static const char *__pyx_f[] = {
799  "proteus/csmoothers.pyx",
800  "stringsource",
801  "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd",
802  "linux2/lib/python2.7/site-packages/Cython/Includes/cpython/type.pxd",
803  "proteus/superluWrappers.pxd",
804 };
805 /* MemviewSliceStruct.proto */
806 struct __pyx_memoryview_obj;
807 typedef struct {
808  struct __pyx_memoryview_obj *memview;
809  char *data;
810  Py_ssize_t shape[8];
811  Py_ssize_t strides[8];
812  Py_ssize_t suboffsets[8];
813 } __Pyx_memviewslice;
814 #define __Pyx_MemoryView_Len(m) (m.shape[0])
815 
816 /* Atomics.proto */
817 #include <pythread.h>
818 #ifndef CYTHON_ATOMICS
819  #define CYTHON_ATOMICS 1
820 #endif
821 #define __pyx_atomic_int_type int
822 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
823  (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
824  !defined(__i386__)
825  #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
826  #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
827  #ifdef __PYX_DEBUG_ATOMICS
828  #warning "Using GNU atomics"
829  #endif
830 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
831  #include <Windows.h>
832  #undef __pyx_atomic_int_type
833  #define __pyx_atomic_int_type LONG
834  #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
835  #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
836  #ifdef __PYX_DEBUG_ATOMICS
837  #pragma message ("Using MSVC atomics")
838  #endif
839 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
840  #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
841  #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
842  #ifdef __PYX_DEBUG_ATOMICS
843  #warning "Using Intel atomics"
844  #endif
845 #else
846  #undef CYTHON_ATOMICS
847  #define CYTHON_ATOMICS 0
848  #ifdef __PYX_DEBUG_ATOMICS
849  #warning "Not using atomics"
850  #endif
851 #endif
852 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
853 #if CYTHON_ATOMICS
854  #define __pyx_add_acquisition_count(memview)\
855  __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
856  #define __pyx_sub_acquisition_count(memview)\
857  __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
858 #else
859  #define __pyx_add_acquisition_count(memview)\
860  __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
861  #define __pyx_sub_acquisition_count(memview)\
862  __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
863 #endif
864 
865 /* ForceInitThreads.proto */
866 #ifndef __PYX_FORCE_INIT_THREADS
867  #define __PYX_FORCE_INIT_THREADS 0
868 #endif
869 
870 /* NoFastGil.proto */
871 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
872 #define __Pyx_PyGILState_Release PyGILState_Release
873 #define __Pyx_FastGIL_Remember()
874 #define __Pyx_FastGIL_Forget()
875 #define __Pyx_FastGilFuncInit()
876 
877 /* BufferFormatStructs.proto */
878 #define IS_UNSIGNED(type) (((type) -1) > 0)
879 struct __Pyx_StructField_;
880 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
881 typedef struct {
882  const char* name;
883  struct __Pyx_StructField_* fields;
884  size_t size;
885  size_t arraysize[8];
886  int ndim;
887  char typegroup;
888  char is_unsigned;
889  int flags;
890 } __Pyx_TypeInfo;
891 typedef struct __Pyx_StructField_ {
892  __Pyx_TypeInfo* type;
893  const char* name;
894  size_t offset;
895 } __Pyx_StructField;
896 typedef struct {
897  __Pyx_StructField* field;
898  size_t parent_offset;
899 } __Pyx_BufFmt_StackElem;
900 typedef struct {
901  __Pyx_StructField root;
902  __Pyx_BufFmt_StackElem* head;
903  size_t fmt_offset;
904  size_t new_count, enc_count;
905  size_t struct_alignment;
906  int is_complex;
907  char enc_type;
908  char new_packmode;
909  char enc_packmode;
910  char is_valid_array;
911 } __Pyx_BufFmt_Context;
912 
913 
914 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":730
915  * # in Cython to enable them only on the right systems.
916  *
917  * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
918  * ctypedef npy_int16 int16_t
919  * ctypedef npy_int32 int32_t
920  */
921 typedef npy_int8 __pyx_t_5numpy_int8_t;
922 
923 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":731
924  *
925  * ctypedef npy_int8 int8_t
926  * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
927  * ctypedef npy_int32 int32_t
928  * ctypedef npy_int64 int64_t
929  */
930 typedef npy_int16 __pyx_t_5numpy_int16_t;
931 
932 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":732
933  * ctypedef npy_int8 int8_t
934  * ctypedef npy_int16 int16_t
935  * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
936  * ctypedef npy_int64 int64_t
937  * #ctypedef npy_int96 int96_t
938  */
939 typedef npy_int32 __pyx_t_5numpy_int32_t;
940 
941 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":733
942  * ctypedef npy_int16 int16_t
943  * ctypedef npy_int32 int32_t
944  * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
945  * #ctypedef npy_int96 int96_t
946  * #ctypedef npy_int128 int128_t
947  */
948 typedef npy_int64 __pyx_t_5numpy_int64_t;
949 
950 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":737
951  * #ctypedef npy_int128 int128_t
952  *
953  * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
954  * ctypedef npy_uint16 uint16_t
955  * ctypedef npy_uint32 uint32_t
956  */
957 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
958 
959 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":738
960  *
961  * ctypedef npy_uint8 uint8_t
962  * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
963  * ctypedef npy_uint32 uint32_t
964  * ctypedef npy_uint64 uint64_t
965  */
966 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
967 
968 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":739
969  * ctypedef npy_uint8 uint8_t
970  * ctypedef npy_uint16 uint16_t
971  * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
972  * ctypedef npy_uint64 uint64_t
973  * #ctypedef npy_uint96 uint96_t
974  */
975 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
976 
977 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":740
978  * ctypedef npy_uint16 uint16_t
979  * ctypedef npy_uint32 uint32_t
980  * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
981  * #ctypedef npy_uint96 uint96_t
982  * #ctypedef npy_uint128 uint128_t
983  */
984 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
985 
986 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":744
987  * #ctypedef npy_uint128 uint128_t
988  *
989  * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
990  * ctypedef npy_float64 float64_t
991  * #ctypedef npy_float80 float80_t
992  */
993 typedef npy_float32 __pyx_t_5numpy_float32_t;
994 
995 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":745
996  *
997  * ctypedef npy_float32 float32_t
998  * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
999  * #ctypedef npy_float80 float80_t
1000  * #ctypedef npy_float128 float128_t
1001  */
1002 typedef npy_float64 __pyx_t_5numpy_float64_t;
1003 
1004 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":754
1005  * # The int types are mapped a bit surprising --
1006  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1007  * ctypedef npy_long int_t # <<<<<<<<<<<<<<
1008  * ctypedef npy_longlong long_t
1009  * ctypedef npy_longlong longlong_t
1010  */
1011 typedef npy_long __pyx_t_5numpy_int_t;
1012 
1013 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":755
1014  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1015  * ctypedef npy_long int_t
1016  * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
1017  * ctypedef npy_longlong longlong_t
1018  *
1019  */
1020 typedef npy_longlong __pyx_t_5numpy_long_t;
1021 
1022 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":756
1023  * ctypedef npy_long int_t
1024  * ctypedef npy_longlong long_t
1025  * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1026  *
1027  * ctypedef npy_ulong uint_t
1028  */
1029 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1030 
1031 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":758
1032  * ctypedef npy_longlong longlong_t
1033  *
1034  * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
1035  * ctypedef npy_ulonglong ulong_t
1036  * ctypedef npy_ulonglong ulonglong_t
1037  */
1038 typedef npy_ulong __pyx_t_5numpy_uint_t;
1039 
1040 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":759
1041  *
1042  * ctypedef npy_ulong uint_t
1043  * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
1044  * ctypedef npy_ulonglong ulonglong_t
1045  *
1046  */
1047 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1048 
1049 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":760
1050  * ctypedef npy_ulong uint_t
1051  * ctypedef npy_ulonglong ulong_t
1052  * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1053  *
1054  * ctypedef npy_intp intp_t
1055  */
1056 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1057 
1058 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":762
1059  * ctypedef npy_ulonglong ulonglong_t
1060  *
1061  * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1062  * ctypedef npy_uintp uintp_t
1063  *
1064  */
1065 typedef npy_intp __pyx_t_5numpy_intp_t;
1066 
1067 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":763
1068  *
1069  * ctypedef npy_intp intp_t
1070  * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1071  *
1072  * ctypedef npy_double float_t
1073  */
1074 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1075 
1076 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":765
1077  * ctypedef npy_uintp uintp_t
1078  *
1079  * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1080  * ctypedef npy_double double_t
1081  * ctypedef npy_longdouble longdouble_t
1082  */
1083 typedef npy_double __pyx_t_5numpy_float_t;
1084 
1085 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":766
1086  *
1087  * ctypedef npy_double float_t
1088  * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1089  * ctypedef npy_longdouble longdouble_t
1090  *
1091  */
1092 typedef npy_double __pyx_t_5numpy_double_t;
1093 
1094 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":767
1095  * ctypedef npy_double float_t
1096  * ctypedef npy_double double_t
1097  * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1098  *
1099  * ctypedef npy_cfloat cfloat_t
1100  */
1101 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1102 
1103 /* "csmoothers.pxd":3
1104  * from proteus cimport superluWrappers
1105  *
1106  * ctypedef int PROTEUS_LAPACK_INTEGER # <<<<<<<<<<<<<<
1107  * # ARB - the compiler macro does not seem to be picking this up...
1108  * ctypedef double [:] DDATA
1109  */
1110 typedef int __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER;
1111 /* Declarations.proto */
1112 #if CYTHON_CCOMPLEX
1113  #ifdef __cplusplus
1114  typedef ::std::complex< float > __pyx_t_float_complex;
1115  #else
1116  typedef float _Complex __pyx_t_float_complex;
1117  #endif
1118 #else
1119  typedef struct { float real, imag; } __pyx_t_float_complex;
1120 #endif
1121 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1122 
1123 /* Declarations.proto */
1124 #if CYTHON_CCOMPLEX
1125  #ifdef __cplusplus
1126  typedef ::std::complex< double > __pyx_t_double_complex;
1127  #else
1128  typedef double _Complex __pyx_t_double_complex;
1129  #endif
1130 #else
1131  typedef struct { double real, imag; } __pyx_t_double_complex;
1132 #endif
1133 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1134 
1135 
1136 /*--- Type declarations ---*/
1137 struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix;
1138 struct __pyx_obj_10csmoothers_cASMFactor;
1139 struct __pyx_obj_10csmoothers_cBASMFactor;
1140 struct __pyx_array_obj;
1141 struct __pyx_MemviewEnum_obj;
1142 struct __pyx_memoryview_obj;
1143 struct __pyx_memoryviewslice_obj;
1144 
1145 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":769
1146  * ctypedef npy_longdouble longdouble_t
1147  *
1148  * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
1149  * ctypedef npy_cdouble cdouble_t
1150  * ctypedef npy_clongdouble clongdouble_t
1151  */
1152 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1153 
1154 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":770
1155  *
1156  * ctypedef npy_cfloat cfloat_t
1157  * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
1158  * ctypedef npy_clongdouble clongdouble_t
1159  *
1160  */
1161 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1162 
1163 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771
1164  * ctypedef npy_cfloat cfloat_t
1165  * ctypedef npy_cdouble cdouble_t
1166  * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
1167  *
1168  * ctypedef npy_cdouble complex_t
1169  */
1170 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1171 
1172 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":773
1173  * ctypedef npy_clongdouble clongdouble_t
1174  *
1175  * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
1176  *
1177  * cdef inline object PyArray_MultiIterNew1(a):
1178  */
1179 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1180 struct __pyx_t_7proteus_15superluWrappers__NRformat;
1181 
1182 /* "superluWrappers.pxd":61
1183  * void csp_preorder "sp_preorder"(_superlu_options_t *, _SuperMatrix *, int *, int *, _SuperMatrix *)
1184  *
1185  * cdef struct _NRformat: # <<<<<<<<<<<<<<
1186  * np.int32_t nnz
1187  * np.float64_t * nzval
1188  */
1189 struct __pyx_t_7proteus_15superluWrappers__NRformat {
1190  __pyx_t_5numpy_int32_t nnz;
1191  __pyx_t_5numpy_float64_t *nzval;
1192  __pyx_t_5numpy_int32_t *colind;
1193  __pyx_t_5numpy_int32_t *rowptr;
1194 };
1195 
1196 /* "csmoothers.pxd":5
1197  * ctypedef int PROTEUS_LAPACK_INTEGER
1198  * # ARB - the compiler macro does not seem to be picking this up...
1199  * ctypedef double [:] DDATA # <<<<<<<<<<<<<<
1200  * ctypedef int [:] IDATA
1201  * ctypedef superluWrappers._SuperMatrix SuperMatrix
1202  */
1203 typedef __Pyx_memviewslice __pyx_t_10csmoothers_DDATA;
1204 
1205 /* "csmoothers.pxd":6
1206  * # ARB - the compiler macro does not seem to be picking this up...
1207  * ctypedef double [:] DDATA
1208  * ctypedef int [:] IDATA # <<<<<<<<<<<<<<
1209  * ctypedef superluWrappers._SuperMatrix SuperMatrix
1210  *
1211  */
1212 typedef __Pyx_memviewslice __pyx_t_10csmoothers_IDATA;
1213 
1214 /* "csmoothers.pxd":7
1215  * ctypedef double [:] DDATA
1216  * ctypedef int [:] IDATA
1217  * ctypedef superluWrappers._SuperMatrix SuperMatrix # <<<<<<<<<<<<<<
1218  *
1219  * cdef extern from "smoothers.h":
1220  */
1221 typedef SuperMatrix __pyx_t_10csmoothers_SuperMatrix;
1222 
1223 /* "superluWrappers.pxd":67
1224  * np.int32_t * rowptr
1225  *
1226  * cdef class cSparseMatrix(object): # <<<<<<<<<<<<<<
1227  * cdef np.int32_t dim[2]
1228  * cdef _NRformat A
1229  */
1230 struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix {
1231  PyObject_HEAD
1232  __pyx_t_5numpy_int32_t dim[2];
1233  struct __pyx_t_7proteus_15superluWrappers__NRformat A;
1234 };
1235 
1236 
1237 /* "csmoothers.pxd":25
1238  * void cbasm_NR_solve "basm_NR_solve"(int rowBlocks, int N, superluWrappers._SuperMatrix *A, double w, double** subdomainL, int* subdomain_dim, int** l2g_L, double* R, double** subdomainR, int* node_order, double** subdomain_dX, double* dX, PROTEUS_LAPACK_INTEGER** subdomainPivots, PROTEUS_LAPACK_INTEGER** subdomainColPivots)
1239  *
1240  * cdef class cASMFactor(object): # <<<<<<<<<<<<<<
1241  * cdef int N
1242  * cdef int *subdomain_dim
1243  */
1244 struct __pyx_obj_10csmoothers_cASMFactor {
1245  PyObject_HEAD
1246  int N;
1247  int *subdomain_dim;
1248  int **l2g_L;
1249  double **subdomain_L;
1250  double **subdomain_R;
1251  double **subdomain_dX;
1252  __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER **subdomain_pivots;
1253 };
1254 
1255 
1256 /* "csmoothers.pxd":34
1257  * cdef PROTEUS_LAPACK_INTEGER **subdomain_pivots
1258  *
1259  * cdef class cBASMFactor(object): # <<<<<<<<<<<<<<
1260  * cdef int N
1261  * cdef int bs
1262  */
1263 struct __pyx_obj_10csmoothers_cBASMFactor {
1264  PyObject_HEAD
1265  int N;
1266  int bs;
1267  int *subdomain_dim;
1268  int **l2g_L;
1269  double **subdomain_L;
1270  double **subdomain_R;
1271  double **subdomain_dX;
1272  __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER **subdomain_pivots;
1273  __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER **subdomain_col_pivots;
1274 };
1275 
1276 
1277 /* "View.MemoryView":104
1278  *
1279  * @cname("__pyx_array")
1280  * cdef class array: # <<<<<<<<<<<<<<
1281  *
1282  * cdef:
1283  */
1284 struct __pyx_array_obj {
1285  PyObject_HEAD
1286  struct __pyx_vtabstruct_array *__pyx_vtab;
1287  char *data;
1288  Py_ssize_t len;
1289  char *format;
1290  int ndim;
1291  Py_ssize_t *_shape;
1292  Py_ssize_t *_strides;
1293  Py_ssize_t itemsize;
1294  PyObject *mode;
1295  PyObject *_format;
1296  void (*callback_free_data)(void *);
1297  int free_data;
1298  int dtype_is_object;
1299 };
1300 
1301 
1302 /* "View.MemoryView":278
1303  *
1304  * @cname('__pyx_MemviewEnum')
1305  * cdef class Enum(object): # <<<<<<<<<<<<<<
1306  * cdef object name
1307  * def __init__(self, name):
1308  */
1309 struct __pyx_MemviewEnum_obj {
1310  PyObject_HEAD
1311  PyObject *name;
1312 };
1313 
1314 
1315 /* "View.MemoryView":329
1316  *
1317  * @cname('__pyx_memoryview')
1318  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1319  *
1320  * cdef object obj
1321  */
1322 struct __pyx_memoryview_obj {
1323  PyObject_HEAD
1324  struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1325  PyObject *obj;
1326  PyObject *_size;
1327  PyObject *_array_interface;
1328  PyThread_type_lock lock;
1329  __pyx_atomic_int acquisition_count[2];
1330  __pyx_atomic_int *acquisition_count_aligned_p;
1331  Py_buffer view;
1332  int flags;
1333  int dtype_is_object;
1334  __Pyx_TypeInfo *typeinfo;
1335 };
1336 
1337 
1338 /* "View.MemoryView":960
1339  *
1340  * @cname('__pyx_memoryviewslice')
1341  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1342  * "Internal class for passing memoryview slices to Python"
1343  *
1344  */
1345 struct __pyx_memoryviewslice_obj {
1346  struct __pyx_memoryview_obj __pyx_base;
1347  __Pyx_memviewslice from_slice;
1348  PyObject *from_object;
1349  PyObject *(*to_object_func)(char *);
1350  int (*to_dtype_func)(char *, PyObject *);
1351 };
1352 
1353 
1354 
1355 /* "View.MemoryView":104
1356  *
1357  * @cname("__pyx_array")
1358  * cdef class array: # <<<<<<<<<<<<<<
1359  *
1360  * cdef:
1361  */
1362 
1363 struct __pyx_vtabstruct_array {
1364  PyObject *(*get_memview)(struct __pyx_array_obj *);
1365 };
1366 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1367 
1368 
1369 /* "View.MemoryView":329
1370  *
1371  * @cname('__pyx_memoryview')
1372  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1373  *
1374  * cdef object obj
1375  */
1376 
1377 struct __pyx_vtabstruct_memoryview {
1378  char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
1379  PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
1380  PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1381  PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
1382  PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1383  PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
1384  PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
1385 };
1386 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1387 
1388 
1389 /* "View.MemoryView":960
1390  *
1391  * @cname('__pyx_memoryviewslice')
1392  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1393  * "Internal class for passing memoryview slices to Python"
1394  *
1395  */
1396 
1397 struct __pyx_vtabstruct__memoryviewslice {
1398  struct __pyx_vtabstruct_memoryview __pyx_base;
1399 };
1400 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1401 
1402 /* --- Runtime support code (head) --- */
1403 /* Refnanny.proto */
1404 #ifndef CYTHON_REFNANNY
1405  #define CYTHON_REFNANNY 0
1406 #endif
1407 #if CYTHON_REFNANNY
1408  typedef struct {
1409  void (*INCREF)(void*, PyObject*, int);
1410  void (*DECREF)(void*, PyObject*, int);
1411  void (*GOTREF)(void*, PyObject*, int);
1412  void (*GIVEREF)(void*, PyObject*, int);
1413  void* (*SetupContext)(const char*, int, const char*);
1414  void (*FinishContext)(void**);
1415  } __Pyx_RefNannyAPIStruct;
1416  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1417  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1418  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1419 #ifdef WITH_THREAD
1420  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1421  if (acquire_gil) {\
1422  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1423  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1424  PyGILState_Release(__pyx_gilstate_save);\
1425  } else {\
1426  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1427  }
1428 #else
1429  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1430  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1431 #endif
1432  #define __Pyx_RefNannyFinishContext()\
1433  __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1434  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1435  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1436  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1437  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1438  #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1439  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1440  #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1441  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1442 #else
1443  #define __Pyx_RefNannyDeclarations
1444  #define __Pyx_RefNannySetupContext(name, acquire_gil)
1445  #define __Pyx_RefNannyFinishContext()
1446  #define __Pyx_INCREF(r) Py_INCREF(r)
1447  #define __Pyx_DECREF(r) Py_DECREF(r)
1448  #define __Pyx_GOTREF(r)
1449  #define __Pyx_GIVEREF(r)
1450  #define __Pyx_XINCREF(r) Py_XINCREF(r)
1451  #define __Pyx_XDECREF(r) Py_XDECREF(r)
1452  #define __Pyx_XGOTREF(r)
1453  #define __Pyx_XGIVEREF(r)
1454 #endif
1455 #define __Pyx_XDECREF_SET(r, v) do {\
1456  PyObject *tmp = (PyObject *) r;\
1457  r = v; __Pyx_XDECREF(tmp);\
1458  } while (0)
1459 #define __Pyx_DECREF_SET(r, v) do {\
1460  PyObject *tmp = (PyObject *) r;\
1461  r = v; __Pyx_DECREF(tmp);\
1462  } while (0)
1463 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1464 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1465 
1466 /* PyObjectGetAttrStr.proto */
1467 #if CYTHON_USE_TYPE_SLOTS
1468 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1469 #else
1470 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1471 #endif
1472 
1473 /* GetBuiltinName.proto */
1474 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1475 
1476 /* RaiseArgTupleInvalid.proto */
1477 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1478  Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1479 
1480 /* RaiseDoubleKeywords.proto */
1481 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1482 
1483 /* ParseKeywords.proto */
1484 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1485  PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1486  const char* function_name);
1487 
1488 /* PyObjectSetAttrStr.proto */
1489 #if CYTHON_USE_TYPE_SLOTS
1490 #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
1491 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
1492 #else
1493 #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
1494 #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
1495 #endif
1496 
1497 /* PyCFunctionFastCall.proto */
1498 #if CYTHON_FAST_PYCCALL
1499 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1500 #else
1501 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1502 #endif
1503 
1504 /* PyFunctionFastCall.proto */
1505 #if CYTHON_FAST_PYCALL
1506 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1507  __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1508 #if 1 || PY_VERSION_HEX < 0x030600B1
1509 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs);
1510 #else
1511 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1512 #endif
1513 #endif
1514 
1515 /* PyObjectCall.proto */
1516 #if CYTHON_COMPILING_IN_CPYTHON
1517 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1518 #else
1519 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1520 #endif
1521 
1522 /* PyObjectCallMethO.proto */
1523 #if CYTHON_COMPILING_IN_CPYTHON
1524 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1525 #endif
1526 
1527 /* PyObjectCallOneArg.proto */
1528 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1529 
1530 /* ArgTypeTest.proto */
1531 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1532  ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1533  __Pyx__ArgTypeTest(obj, type, name, exact))
1534 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1535 
1536 /* PyThreadStateGet.proto */
1537 #if CYTHON_FAST_THREAD_STATE
1538 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1539 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1540 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1541 #else
1542 #define __Pyx_PyThreadState_declare
1543 #define __Pyx_PyThreadState_assign
1544 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1545 #endif
1546 
1547 /* PyErrFetchRestore.proto */
1548 #if CYTHON_FAST_THREAD_STATE
1549 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1550 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1551 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1552 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1553 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1554 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1555 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1556 #if CYTHON_COMPILING_IN_CPYTHON
1557 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1558 #else
1559 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1560 #endif
1561 #else
1562 #define __Pyx_PyErr_Clear() PyErr_Clear()
1563 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1564 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1565 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1566 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1567 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1568 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1569 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1570 #endif
1571 
1572 /* RaiseException.proto */
1573 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1574 
1575 /* ExtTypeTest.proto */
1576 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1577 
1578 /* MemviewSliceInit.proto */
1579 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
1580 #define __Pyx_MEMVIEW_DIRECT 1
1581 #define __Pyx_MEMVIEW_PTR 2
1582 #define __Pyx_MEMVIEW_FULL 4
1583 #define __Pyx_MEMVIEW_CONTIG 8
1584 #define __Pyx_MEMVIEW_STRIDED 16
1585 #define __Pyx_MEMVIEW_FOLLOW 32
1586 #define __Pyx_IS_C_CONTIG 1
1587 #define __Pyx_IS_F_CONTIG 2
1588 static int __Pyx_init_memviewslice(
1589  struct __pyx_memoryview_obj *memview,
1590  int ndim,
1591  __Pyx_memviewslice *memviewslice,
1592  int memview_is_new_reference);
1593 static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
1594  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1595 static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
1596  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1597 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
1598 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
1599 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
1600 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
1601 static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
1602 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
1603 
1604 /* BufferIndexError.proto */
1605 static void __Pyx_RaiseBufferIndexError(int axis);
1606 
1607 /* WriteUnraisableException.proto */
1608 static void __Pyx_WriteUnraisable(const char *name, int clineno,
1609  int lineno, const char *filename,
1610  int full_traceback, int nogil);
1611 
1612 /* DictGetItem.proto */
1613 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1614 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1615 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
1616  (likely(PyDict_CheckExact(obj)) ?\
1617  __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
1618 #else
1619 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1620 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
1621 #endif
1622 
1623 /* RaiseTooManyValuesToUnpack.proto */
1624 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1625 
1626 /* RaiseNeedMoreValuesToUnpack.proto */
1627 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1628 
1629 /* RaiseNoneIterError.proto */
1630 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
1631 
1632 /* SaveResetException.proto */
1633 #if CYTHON_FAST_THREAD_STATE
1634 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1635 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1636 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1637 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1638 #else
1639 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1640 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1641 #endif
1642 
1643 /* PyErrExceptionMatches.proto */
1644 #if CYTHON_FAST_THREAD_STATE
1645 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1646 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1647 #else
1648 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1649 #endif
1650 
1651 /* GetException.proto */
1652 #if CYTHON_FAST_THREAD_STATE
1653 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1654 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1655 #else
1656 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1657 #endif
1658 
1659 /* IncludeStringH.proto */
1660 #include <string.h>
1661 
1662 /* BytesEquals.proto */
1663 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
1664 
1665 /* UnicodeEquals.proto */
1666 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
1667 
1668 /* StrEquals.proto */
1669 #if PY_MAJOR_VERSION >= 3
1670 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
1671 #else
1672 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
1673 #endif
1674 
1675 /* None.proto */
1676 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
1677 
1678 /* UnaryNegOverflows.proto */
1679 #define UNARY_NEG_WOULD_OVERFLOW(x)\
1680  (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
1681 
1682 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
1683 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
1684 /* GetAttr.proto */
1685 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1686 
1687 /* GetItemInt.proto */
1688 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1689  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1690  __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1691  (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1692  __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1693 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1694  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1695  __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1696  (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1697 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1698  int wraparound, int boundscheck);
1699 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1700  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1701  __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1702  (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1703 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1704  int wraparound, int boundscheck);
1705 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1706 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1707  int is_list, int wraparound, int boundscheck);
1708 
1709 /* ObjectGetItem.proto */
1710 #if CYTHON_USE_TYPE_SLOTS
1711 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1712 #else
1713 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1714 #endif
1715 
1716 /* decode_c_string_utf16.proto */
1717 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
1718  int byteorder = 0;
1719  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1720 }
1721 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
1722  int byteorder = -1;
1723  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1724 }
1725 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
1726  int byteorder = 1;
1727  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1728 }
1729 
1730 /* decode_c_string.proto */
1731 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
1732  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
1733  const char* encoding, const char* errors,
1734  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
1735 
1736 /* GetAttr3.proto */
1737 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1738 
1739 /* GetModuleGlobalName.proto */
1740 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
1741 
1742 /* SwapException.proto */
1743 #if CYTHON_FAST_THREAD_STATE
1744 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
1745 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1746 #else
1747 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1748 #endif
1749 
1750 /* Import.proto */
1751 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1752 
1753 /* FastTypeChecks.proto */
1754 #if CYTHON_COMPILING_IN_CPYTHON
1755 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1756 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1757 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1758 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1759 #else
1760 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1761 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1762 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1763 #endif
1764 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1765 
1766 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
1767 /* ListCompAppend.proto */
1768 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1769 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
1770  PyListObject* L = (PyListObject*) list;
1771  Py_ssize_t len = Py_SIZE(list);
1772  if (likely(L->allocated > len)) {
1773  Py_INCREF(x);
1774  PyList_SET_ITEM(list, len, x);
1775  Py_SIZE(list) = len+1;
1776  return 0;
1777  }
1778  return PyList_Append(list, x);
1779 }
1780 #else
1781 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
1782 #endif
1783 
1784 /* PyIntBinop.proto */
1785 #if !CYTHON_COMPILING_IN_PYPY
1786 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
1787 #else
1788 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\
1789  (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1790 #endif
1791 
1792 /* ListExtend.proto */
1793 static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
1794 #if CYTHON_COMPILING_IN_CPYTHON
1795  PyObject* none = _PyList_Extend((PyListObject*)L, v);
1796  if (unlikely(!none))
1797  return -1;
1798  Py_DECREF(none);
1799  return 0;
1800 #else
1801  return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
1802 #endif
1803 }
1804 
1805 /* ListAppend.proto */
1806 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1807 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
1808  PyListObject* L = (PyListObject*) list;
1809  Py_ssize_t len = Py_SIZE(list);
1810  if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
1811  Py_INCREF(x);
1812  PyList_SET_ITEM(list, len, x);
1813  Py_SIZE(list) = len+1;
1814  return 0;
1815  }
1816  return PyList_Append(list, x);
1817 }
1818 #else
1819 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
1820 #endif
1821 
1822 /* None.proto */
1823 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
1824 
1825 /* None.proto */
1826 static CYTHON_INLINE long __Pyx_div_long(long, long);
1827 
1828 /* ImportFrom.proto */
1829 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1830 
1831 /* HasAttr.proto */
1832 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
1833 
1834 /* PyObject_GenericGetAttrNoDict.proto */
1835 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1836 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1837 #else
1838 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1839 #endif
1840 
1841 /* PyObject_GenericGetAttr.proto */
1842 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1843 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1844 #else
1845 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1846 #endif
1847 
1848 /* SetupReduce.proto */
1849 static int __Pyx_setup_reduce(PyObject* type_obj);
1850 
1851 /* SetVTable.proto */
1852 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
1853 
1854 /* CalculateMetaclass.proto */
1855 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
1856 
1857 /* FetchCommonType.proto */
1858 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
1859 
1860 /* CythonFunction.proto */
1861 #define __Pyx_CyFunction_USED 1
1862 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
1863 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
1864 #define __Pyx_CYFUNCTION_CCLASS 0x04
1865 #define __Pyx_CyFunction_GetClosure(f)\
1866  (((__pyx_CyFunctionObject *) (f))->func_closure)
1867 #define __Pyx_CyFunction_GetClassObj(f)\
1868  (((__pyx_CyFunctionObject *) (f))->func_classobj)
1869 #define __Pyx_CyFunction_Defaults(type, f)\
1870  ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
1871 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
1872  ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
1873 typedef struct {
1874  PyCFunctionObject func;
1875 #if PY_VERSION_HEX < 0x030500A0
1876  PyObject *func_weakreflist;
1877 #endif
1878  PyObject *func_dict;
1879  PyObject *func_name;
1880  PyObject *func_qualname;
1881  PyObject *func_doc;
1882  PyObject *func_globals;
1883  PyObject *func_code;
1884  PyObject *func_closure;
1885  PyObject *func_classobj;
1886  void *defaults;
1887  int defaults_pyobjects;
1888  int flags;
1889  PyObject *defaults_tuple;
1890  PyObject *defaults_kwdict;
1891  PyObject *(*defaults_getter)(PyObject *);
1892  PyObject *func_annotations;
1893 } __pyx_CyFunctionObject;
1894 static PyTypeObject *__pyx_CyFunctionType = 0;
1895 #define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\
1896  __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code)
1897 static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml,
1898  int flags, PyObject* qualname,
1899  PyObject *self,
1900  PyObject *module, PyObject *globals,
1901  PyObject* code);
1902 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
1903  size_t size,
1904  int pyobjects);
1905 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
1906  PyObject *tuple);
1907 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
1908  PyObject *dict);
1909 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
1910  PyObject *dict);
1911 static int __pyx_CyFunction_init(void);
1912 
1913 /* SetNameInClass.proto */
1914 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
1915 #define __Pyx_SetNameInClass(ns, name, value)\
1916  (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
1917 #elif CYTHON_COMPILING_IN_CPYTHON
1918 #define __Pyx_SetNameInClass(ns, name, value)\
1919  (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
1920 #else
1921 #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
1922 #endif
1923 
1924 /* Py3ClassCreate.proto */
1925 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
1926  PyObject *mkw, PyObject *modname, PyObject *doc);
1927 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
1928  PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);
1929 
1930 /* CLineInTraceback.proto */
1931 #ifdef CYTHON_CLINE_IN_TRACEBACK
1932 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1933 #else
1934 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1935 #endif
1936 
1937 /* CodeObjectCache.proto */
1938 typedef struct {
1939  PyCodeObject* code_object;
1940  int code_line;
1941 } __Pyx_CodeObjectCacheEntry;
1942 struct __Pyx_CodeObjectCache {
1943  int count;
1944  int max_count;
1945  __Pyx_CodeObjectCacheEntry* entries;
1946 };
1947 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1948 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
1949 static PyCodeObject *__pyx_find_code_object(int code_line);
1950 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
1951 
1952 /* AddTraceback.proto */
1953 static void __Pyx_AddTraceback(const char *funcname, int c_line,
1954  int py_line, const char *filename);
1955 
1956 #if PY_MAJOR_VERSION < 3
1957  static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
1958  static void __Pyx_ReleaseBuffer(Py_buffer *view);
1959 #else
1960  #define __Pyx_GetBuffer PyObject_GetBuffer
1961  #define __Pyx_ReleaseBuffer PyBuffer_Release
1962 #endif
1963 
1964 
1965 /* BufferStructDeclare.proto */
1966 typedef struct {
1967  Py_ssize_t shape, strides, suboffsets;
1968 } __Pyx_Buf_DimInfo;
1969 typedef struct {
1970  size_t refcount;
1971  Py_buffer pybuffer;
1972 } __Pyx_Buffer;
1973 typedef struct {
1974  __Pyx_Buffer *rcbuffer;
1975  char *data;
1976  __Pyx_Buf_DimInfo diminfo[8];
1977 } __Pyx_LocalBuf_ND;
1978 
1979 /* MemviewSliceIsContig.proto */
1980 static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
1981 
1982 /* OverlappingSlices.proto */
1983 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
1984  __Pyx_memviewslice *slice2,
1985  int ndim, size_t itemsize);
1986 
1987 /* Capsule.proto */
1988 static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
1989 
1990 /* RealImag.proto */
1991 #if CYTHON_CCOMPLEX
1992  #ifdef __cplusplus
1993  #define __Pyx_CREAL(z) ((z).real())
1994  #define __Pyx_CIMAG(z) ((z).imag())
1995  #else
1996  #define __Pyx_CREAL(z) (__real__(z))
1997  #define __Pyx_CIMAG(z) (__imag__(z))
1998  #endif
1999 #else
2000  #define __Pyx_CREAL(z) ((z).real)
2001  #define __Pyx_CIMAG(z) ((z).imag)
2002 #endif
2003 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2004  && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2005  #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2006  #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2007 #else
2008  #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2009  #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2010 #endif
2011 
2012 /* Arithmetic.proto */
2013 #if CYTHON_CCOMPLEX
2014  #define __Pyx_c_eq_float(a, b) ((a)==(b))
2015  #define __Pyx_c_sum_float(a, b) ((a)+(b))
2016  #define __Pyx_c_diff_float(a, b) ((a)-(b))
2017  #define __Pyx_c_prod_float(a, b) ((a)*(b))
2018  #define __Pyx_c_quot_float(a, b) ((a)/(b))
2019  #define __Pyx_c_neg_float(a) (-(a))
2020  #ifdef __cplusplus
2021  #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2022  #define __Pyx_c_conj_float(z) (::std::conj(z))
2023  #if 1
2024  #define __Pyx_c_abs_float(z) (::std::abs(z))
2025  #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2026  #endif
2027  #else
2028  #define __Pyx_c_is_zero_float(z) ((z)==0)
2029  #define __Pyx_c_conj_float(z) (conjf(z))
2030  #if 1
2031  #define __Pyx_c_abs_float(z) (cabsf(z))
2032  #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2033  #endif
2034  #endif
2035 #else
2036  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2037  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2038  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2039  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2040  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2041  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2042  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2043  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2044  #if 1
2045  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
2046  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2047  #endif
2048 #endif
2049 
2050 /* Arithmetic.proto */
2051 #if CYTHON_CCOMPLEX
2052  #define __Pyx_c_eq_double(a, b) ((a)==(b))
2053  #define __Pyx_c_sum_double(a, b) ((a)+(b))
2054  #define __Pyx_c_diff_double(a, b) ((a)-(b))
2055  #define __Pyx_c_prod_double(a, b) ((a)*(b))
2056  #define __Pyx_c_quot_double(a, b) ((a)/(b))
2057  #define __Pyx_c_neg_double(a) (-(a))
2058  #ifdef __cplusplus
2059  #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2060  #define __Pyx_c_conj_double(z) (::std::conj(z))
2061  #if 1
2062  #define __Pyx_c_abs_double(z) (::std::abs(z))
2063  #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2064  #endif
2065  #else
2066  #define __Pyx_c_is_zero_double(z) ((z)==0)
2067  #define __Pyx_c_conj_double(z) (conj(z))
2068  #if 1
2069  #define __Pyx_c_abs_double(z) (cabs(z))
2070  #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2071  #endif
2072  #endif
2073 #else
2074  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2075  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2076  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2077  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2078  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2079  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2080  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2081  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2082  #if 1
2083  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
2084  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2085  #endif
2086 #endif
2087 
2088 /* CIntToPy.proto */
2089 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2090 
2091 /* CIntToPy.proto */
2092 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);
2093 
2094 /* MemviewSliceCopyTemplate.proto */
2095 static __Pyx_memviewslice
2096 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
2097  const char *mode, int ndim,
2098  size_t sizeof_dtype, int contig_flag,
2099  int dtype_is_object);
2100 
2101 /* CIntFromPy.proto */
2102 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2103 
2104 /* CIntFromPy.proto */
2105 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2106 
2107 /* CIntToPy.proto */
2108 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2109 
2110 /* CIntFromPy.proto */
2111 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
2112 
2113 /* IsLittleEndian.proto */
2114 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
2115 
2116 /* BufferFormatCheck.proto */
2117 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
2118 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2119  __Pyx_BufFmt_StackElem* stack,
2120  __Pyx_TypeInfo* type);
2121 
2122 /* TypeInfoCompare.proto */
2123 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2124 
2125 /* MemviewSliceValidateAndInit.proto */
2126 static int __Pyx_ValidateAndInit_memviewslice(
2127  int *axes_specs,
2128  int c_or_f_flag,
2129  int buf_flags,
2130  int ndim,
2131  __Pyx_TypeInfo *dtype,
2132  __Pyx_BufFmt_StackElem stack[],
2133  __Pyx_memviewslice *memviewslice,
2134  PyObject *original_obj);
2135 
2136 /* ObjectToMemviewSlice.proto */
2137 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *, int writable_flag);
2138 
2139 /* ObjectToMemviewSlice.proto */
2140 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *, int writable_flag);
2141 
2142 /* CheckBinaryVersion.proto */
2143 static int __Pyx_check_binary_version(void);
2144 
2145 /* PyIdentifierFromString.proto */
2146 #if !defined(__Pyx_PyIdentifier_FromString)
2147 #if PY_MAJOR_VERSION < 3
2148  #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
2149 #else
2150  #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
2151 #endif
2152 #endif
2153 
2154 /* ModuleImport.proto */
2155 static PyObject *__Pyx_ImportModule(const char *name);
2156 
2157 /* TypeImport.proto */
2158 static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);
2159 
2160 /* InitStrings.proto */
2161 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2162 
2163 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
2164 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
2165 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
2166 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
2167 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
2168 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
2169 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2170 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2171 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2172 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2173 
2174 /* Module declarations from 'proteus' */
2175 
2176 /* Module declarations from 'cpython.buffer' */
2177 
2178 /* Module declarations from 'libc.string' */
2179 
2180 /* Module declarations from 'libc.stdio' */
2181 
2182 /* Module declarations from '__builtin__' */
2183 
2184 /* Module declarations from 'cpython.type' */
2185 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2186 
2187 /* Module declarations from 'cpython' */
2188 
2189 /* Module declarations from 'cpython.object' */
2190 
2191 /* Module declarations from 'cpython.ref' */
2192 
2193 /* Module declarations from 'cpython.mem' */
2194 
2195 /* Module declarations from 'numpy' */
2196 
2197 /* Module declarations from 'numpy' */
2198 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2199 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2200 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2201 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2202 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2203 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
2204 
2205 /* Module declarations from 'proteus.superluWrappers' */
2206 static PyTypeObject *__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix = 0;
2207 
2208 /* Module declarations from 'cython.view' */
2209 
2210 /* Module declarations from 'cython' */
2211 
2212 /* Module declarations from 'csmoothers' */
2213 static PyTypeObject *__pyx_ptype_10csmoothers_cASMFactor = 0;
2214 static PyTypeObject *__pyx_ptype_10csmoothers_cBASMFactor = 0;
2215 static PyTypeObject *__pyx_array_type = 0;
2216 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2217 static PyTypeObject *__pyx_memoryview_type = 0;
2218 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2219 static PyObject *generic = 0;
2220 static PyObject *strided = 0;
2221 static PyObject *indirect = 0;
2222 static PyObject *contiguous = 0;
2223 static PyObject *indirect_contiguous = 0;
2224 static int __pyx_memoryview_thread_locks_used;
2225 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2226 static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, double, double, __pyx_t_10csmoothers_DDATA); /*proto*/
2227 static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA); /*proto*/
2228 static void __pyx_f_10csmoothers_smootherWrappersnl_jacobi_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA, double, double, __pyx_t_10csmoothers_DDATA); /*proto*/
2229 static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, double, double, __pyx_t_10csmoothers_DDATA); /*proto*/
2230 static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA); /*proto*/
2231 static PyObject *__pyx_f_10csmoothers_smootherWrappers_nl_gauss_seidel_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA, double, double, __pyx_t_10csmoothers_DDATA); /*proto*/
2232 static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, struct __pyx_obj_10csmoothers_cASMFactor *); /*proto*/
2233 static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, double, struct __pyx_obj_10csmoothers_cASMFactor *, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA); /*proto*/
2234 static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, struct __pyx_obj_10csmoothers_cBASMFactor *); /*proto*/
2235 static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, double, struct __pyx_obj_10csmoothers_cBASMFactor *, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA); /*proto*/
2236 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
2237 static void *__pyx_align_pointer(void *, size_t); /*proto*/
2238 static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
2239 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
2240 static PyObject *_unellipsify(PyObject *, int); /*proto*/
2241 static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
2242 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
2243 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
2244 static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
2245 static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
2246 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
2247 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2248 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2249 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
2250 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2251 static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
2252 static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
2253 static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
2254 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
2255 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
2256 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
2257 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
2258 static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
2259 static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
2260 static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
2261 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
2262 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
2263 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
2264 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2265 static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2266 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
2267 static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
2268 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
2269 static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
2270 static __Pyx_TypeInfo __Pyx_TypeInfo_int = { "int", NULL, sizeof(int), { 0 }, 0, IS_UNSIGNED(int) ? 'U' : 'I', IS_UNSIGNED(int), 0 };
2271 #define __Pyx_MODULE_NAME "csmoothers"
2272 extern int __pyx_module_is_main_csmoothers;
2273 int __pyx_module_is_main_csmoothers = 0;
2274 
2275 /* Implementation of 'csmoothers' */
2276 static PyObject *__pyx_builtin_object;
2277 static PyObject *__pyx_builtin_TypeError;
2278 static PyObject *__pyx_builtin_ValueError;
2279 static PyObject *__pyx_builtin_range;
2280 static PyObject *__pyx_builtin_RuntimeError;
2281 static PyObject *__pyx_builtin_ImportError;
2282 static PyObject *__pyx_builtin_MemoryError;
2283 static PyObject *__pyx_builtin_enumerate;
2284 static PyObject *__pyx_builtin_Ellipsis;
2285 static PyObject *__pyx_builtin_id;
2286 static PyObject *__pyx_builtin_IndexError;
2287 static const char __pyx_k_A[] = "A";
2288 static const char __pyx_k_L[] = "L";
2289 static const char __pyx_k_M[] = "M";
2290 static const char __pyx_k_O[] = "O";
2291 static const char __pyx_k_R[] = "R";
2292 static const char __pyx_k_c[] = "c";
2293 static const char __pyx_k_w[] = "w";
2294 static const char __pyx_k_bs[] = "bs";
2295 static const char __pyx_k_dX[] = "dX";
2296 static const char __pyx_k_id[] = "id";
2297 static const char __pyx_k_nc[] = "nc";
2298 static const char __pyx_k_np[] = "np";
2299 static const char __pyx_k_nr[] = "nr";
2300 static const char __pyx_k_doc[] = "__doc__";
2301 static const char __pyx_k_new[] = "__new__";
2302 static const char __pyx_k_obj[] = "obj";
2303 static const char __pyx_k_tol[] = "tol";
2304 static const char __pyx_k_base[] = "base";
2305 static const char __pyx_k_dict[] = "__dict__";
2306 static const char __pyx_k_init[] = "__init__";
2307 static const char __pyx_k_main[] = "__main__";
2308 static const char __pyx_k_mode[] = "mode";
2309 static const char __pyx_k_name[] = "name";
2310 static const char __pyx_k_ndim[] = "ndim";
2311 static const char __pyx_k_pack[] = "pack";
2312 static const char __pyx_k_self[] = "self";
2313 static const char __pyx_k_size[] = "size";
2314 static const char __pyx_k_step[] = "step";
2315 static const char __pyx_k_stop[] = "stop";
2316 static const char __pyx_k_test[] = "__test__";
2317 static const char __pyx_k_ASCII[] = "ASCII";
2318 static const char __pyx_k_class[] = "__class__";
2319 static const char __pyx_k_error[] = "error";
2320 static const char __pyx_k_flags[] = "flags";
2321 static const char __pyx_k_numpy[] = "numpy";
2322 static const char __pyx_k_range[] = "range";
2323 static const char __pyx_k_shape[] = "shape";
2324 static const char __pyx_k_start[] = "start";
2325 static const char __pyx_k_encode[] = "encode";
2326 static const char __pyx_k_format[] = "format";
2327 static const char __pyx_k_import[] = "__import__";
2328 static const char __pyx_k_module[] = "__module__";
2329 static const char __pyx_k_name_2[] = "__name__";
2330 static const char __pyx_k_object[] = "object";
2331 static const char __pyx_k_pickle[] = "pickle";
2332 static const char __pyx_k_reduce[] = "__reduce__";
2333 static const char __pyx_k_struct[] = "struct";
2334 static const char __pyx_k_unpack[] = "unpack";
2335 static const char __pyx_k_update[] = "update";
2336 static const char __pyx_k_fortran[] = "fortran";
2337 static const char __pyx_k_memview[] = "memview";
2338 static const char __pyx_k_prepare[] = "__prepare__";
2339 static const char __pyx_k_Ellipsis[] = "Ellipsis";
2340 static const char __pyx_k_getstate[] = "__getstate__";
2341 static const char __pyx_k_itemsize[] = "itemsize";
2342 static const char __pyx_k_pyx_type[] = "__pyx_type";
2343 static const char __pyx_k_qualname[] = "__qualname__";
2344 static const char __pyx_k_setstate[] = "__setstate__";
2345 static const char __pyx_k_ASMFactor[] = "ASMFactor";
2346 static const char __pyx_k_TypeError[] = "TypeError";
2347 static const char __pyx_k_asmFactor[] = "asmFactor";
2348 static const char __pyx_k_enumerate[] = "enumerate";
2349 static const char __pyx_k_metaclass[] = "__metaclass__";
2350 static const char __pyx_k_pyx_state[] = "__pyx_state";
2351 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
2352 static const char __pyx_k_BASMFactor[] = "BASMFactor";
2353 static const char __pyx_k_IndexError[] = "IndexError";
2354 static const char __pyx_k_ValueError[] = "ValueError";
2355 static const char __pyx_k_basmFactor[] = "basmFactor";
2356 static const char __pyx_k_cASMFactor[] = "_cASMFactor";
2357 static const char __pyx_k_csmoothers[] = "csmoothers";
2358 static const char __pyx_k_node_order[] = "node_order";
2359 static const char __pyx_k_pyx_result[] = "__pyx_result";
2360 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2361 static const char __pyx_k_ImportError[] = "ImportError";
2362 static const char __pyx_k_MemoryError[] = "MemoryError";
2363 static const char __pyx_k_PickleError[] = "PickleError";
2364 static const char __pyx_k_cBASMFactor[] = "_cBASMFactor";
2365 static const char __pyx_k_RuntimeError[] = "RuntimeError";
2366 static const char __pyx_k_asm_NR_solve[] = "asm_NR_solve";
2367 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
2368 static const char __pyx_k_stringsource[] = "stringsource";
2369 static const char __pyx_k_basm_NR_solve[] = "basm_NR_solve";
2370 static const char __pyx_k_cSparseMatrix[] = "_cSparseMatrix";
2371 static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
2372 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
2373 static const char __pyx_k_asm_NR_prepare[] = "asm_NR_prepare";
2374 static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
2375 static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
2376 static const char __pyx_k_basm_NR_prepare[] = "basm_NR_prepare";
2377 static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
2378 static const char __pyx_k_jacobi_NR_solve[] = "jacobi_NR_solve";
2379 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
2380 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
2381 static const char __pyx_k_ASMFactor___init[] = "ASMFactor.__init__";
2382 static const char __pyx_k_BASMFactor___init[] = "BASMFactor.__init__";
2383 static const char __pyx_k_jacobi_NR_prepare[] = "jacobi_NR_prepare";
2384 static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
2385 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2386 static const char __pyx_k_nl_jacobi_NR_solve[] = "nl_jacobi_NR_solve";
2387 static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
2388 static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
2389 static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
2390 static const char __pyx_k_gauss_seidel_NR_solve[] = "gauss_seidel_NR_solve";
2391 static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
2392 static const char __pyx_k_gauss_seidel_NR_preare[] = "gauss_seidel_NR_preare";
2393 static const char __pyx_k_proteus_csmoothers_pyx[] = "proteus/csmoothers.pyx";
2394 static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
2395 static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
2396 static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
2397 static const char __pyx_k_nl_gauss_seidel_NR_solve[] = "nl_gauss_seidel_NR_solve";
2398 static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
2399 static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
2400 static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
2401 static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
2402 static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
2403 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
2404 static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
2405 static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
2406 static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
2407 static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
2408 static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
2409 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
2410 static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
2411 static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))";
2412 static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
2413 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
2414 static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
2415 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
2416 static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
2417 static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
2418 static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
2419 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
2420 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
2421 static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
2422 static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
2423 static PyObject *__pyx_n_s_A;
2424 static PyObject *__pyx_n_s_ASCII;
2425 static PyObject *__pyx_n_s_ASMFactor;
2426 static PyObject *__pyx_n_s_ASMFactor___init;
2427 static PyObject *__pyx_n_s_BASMFactor;
2428 static PyObject *__pyx_n_s_BASMFactor___init;
2429 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2430 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2431 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2432 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2433 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2434 static PyObject *__pyx_n_s_Ellipsis;
2435 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2436 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
2437 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
2438 static PyObject *__pyx_n_s_ImportError;
2439 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0;
2440 static PyObject *__pyx_n_s_IndexError;
2441 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2442 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2443 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2444 static PyObject *__pyx_n_s_L;
2445 static PyObject *__pyx_n_s_M;
2446 static PyObject *__pyx_n_s_MemoryError;
2447 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2448 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2449 static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
2450 static PyObject *__pyx_n_b_O;
2451 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2452 static PyObject *__pyx_n_s_PickleError;
2453 static PyObject *__pyx_n_s_R;
2454 static PyObject *__pyx_n_s_RuntimeError;
2455 static PyObject *__pyx_n_s_TypeError;
2456 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2457 static PyObject *__pyx_n_s_ValueError;
2458 static PyObject *__pyx_n_s_View_MemoryView;
2459 static PyObject *__pyx_n_s_allocate_buffer;
2460 static PyObject *__pyx_n_s_asmFactor;
2461 static PyObject *__pyx_n_s_asm_NR_prepare;
2462 static PyObject *__pyx_n_s_asm_NR_solve;
2463 static PyObject *__pyx_n_s_base;
2464 static PyObject *__pyx_n_s_basmFactor;
2465 static PyObject *__pyx_n_s_basm_NR_prepare;
2466 static PyObject *__pyx_n_s_basm_NR_solve;
2467 static PyObject *__pyx_n_s_bs;
2468 static PyObject *__pyx_n_s_c;
2469 static PyObject *__pyx_n_u_c;
2470 static PyObject *__pyx_n_s_cASMFactor;
2471 static PyObject *__pyx_n_s_cBASMFactor;
2472 static PyObject *__pyx_n_s_cSparseMatrix;
2473 static PyObject *__pyx_n_s_class;
2474 static PyObject *__pyx_n_s_cline_in_traceback;
2475 static PyObject *__pyx_kp_s_contiguous_and_direct;
2476 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2477 static PyObject *__pyx_n_s_csmoothers;
2478 static PyObject *__pyx_n_s_dX;
2479 static PyObject *__pyx_n_s_dict;
2480 static PyObject *__pyx_n_s_doc;
2481 static PyObject *__pyx_n_s_dtype_is_object;
2482 static PyObject *__pyx_n_s_encode;
2483 static PyObject *__pyx_n_s_enumerate;
2484 static PyObject *__pyx_n_s_error;
2485 static PyObject *__pyx_n_s_flags;
2486 static PyObject *__pyx_n_s_format;
2487 static PyObject *__pyx_n_s_fortran;
2488 static PyObject *__pyx_n_u_fortran;
2489 static PyObject *__pyx_n_s_gauss_seidel_NR_preare;
2490 static PyObject *__pyx_n_s_gauss_seidel_NR_solve;
2491 static PyObject *__pyx_n_s_getstate;
2492 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2493 static PyObject *__pyx_n_s_id;
2494 static PyObject *__pyx_n_s_import;
2495 static PyObject *__pyx_n_s_init;
2496 static PyObject *__pyx_n_s_itemsize;
2497 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2498 static PyObject *__pyx_n_s_jacobi_NR_prepare;
2499 static PyObject *__pyx_n_s_jacobi_NR_solve;
2500 static PyObject *__pyx_n_s_main;
2501 static PyObject *__pyx_n_s_memview;
2502 static PyObject *__pyx_n_s_metaclass;
2503 static PyObject *__pyx_n_s_mode;
2504 static PyObject *__pyx_n_s_module;
2505 static PyObject *__pyx_n_s_name;
2506 static PyObject *__pyx_n_s_name_2;
2507 static PyObject *__pyx_n_s_nc;
2508 static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
2509 static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
2510 static PyObject *__pyx_n_s_ndim;
2511 static PyObject *__pyx_n_s_new;
2512 static PyObject *__pyx_n_s_nl_gauss_seidel_NR_solve;
2513 static PyObject *__pyx_n_s_nl_jacobi_NR_solve;
2514 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2515 static PyObject *__pyx_n_s_node_order;
2516 static PyObject *__pyx_n_s_np;
2517 static PyObject *__pyx_n_s_nr;
2518 static PyObject *__pyx_n_s_numpy;
2519 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2520 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2521 static PyObject *__pyx_n_s_obj;
2522 static PyObject *__pyx_n_s_object;
2523 static PyObject *__pyx_n_s_pack;
2524 static PyObject *__pyx_n_s_pickle;
2525 static PyObject *__pyx_n_s_prepare;
2526 static PyObject *__pyx_kp_s_proteus_csmoothers_pyx;
2527 static PyObject *__pyx_n_s_pyx_PickleError;
2528 static PyObject *__pyx_n_s_pyx_checksum;
2529 static PyObject *__pyx_n_s_pyx_getbuffer;
2530 static PyObject *__pyx_n_s_pyx_result;
2531 static PyObject *__pyx_n_s_pyx_state;
2532 static PyObject *__pyx_n_s_pyx_type;
2533 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2534 static PyObject *__pyx_n_s_pyx_vtable;
2535 static PyObject *__pyx_n_s_qualname;
2536 static PyObject *__pyx_n_s_range;
2537 static PyObject *__pyx_n_s_reduce;
2538 static PyObject *__pyx_n_s_reduce_cython;
2539 static PyObject *__pyx_n_s_reduce_ex;
2540 static PyObject *__pyx_n_s_self;
2541 static PyObject *__pyx_n_s_setstate;
2542 static PyObject *__pyx_n_s_setstate_cython;
2543 static PyObject *__pyx_n_s_shape;
2544 static PyObject *__pyx_n_s_size;
2545 static PyObject *__pyx_n_s_start;
2546 static PyObject *__pyx_n_s_step;
2547 static PyObject *__pyx_n_s_stop;
2548 static PyObject *__pyx_kp_s_strided_and_direct;
2549 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2550 static PyObject *__pyx_kp_s_strided_and_indirect;
2551 static PyObject *__pyx_kp_s_stringsource;
2552 static PyObject *__pyx_n_s_struct;
2553 static PyObject *__pyx_n_s_test;
2554 static PyObject *__pyx_n_s_tol;
2555 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2556 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2557 static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
2558 static PyObject *__pyx_n_s_unpack;
2559 static PyObject *__pyx_n_s_update;
2560 static PyObject *__pyx_n_s_w;
2561 static PyObject *__pyx_pf_10csmoothers_9ASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L); /* proto */
2562 static int __pyx_pf_10csmoothers_10cASMFactor___cinit__(struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self, struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L); /* proto */
2563 static void __pyx_pf_10csmoothers_10cASMFactor_2__dealloc__(struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self); /* proto */
2564 static PyObject *__pyx_pf_10csmoothers_10cASMFactor_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self); /* proto */
2565 static PyObject *__pyx_pf_10csmoothers_10cASMFactor_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2566 static PyObject *__pyx_pf_10csmoothers_10BASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L, PyObject *__pyx_v_bs); /* proto */
2567 static int __pyx_pf_10csmoothers_11cBASMFactor___cinit__(struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self, struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L, int __pyx_v_bs); /* proto */
2568 static void __pyx_pf_10csmoothers_11cBASMFactor_2__dealloc__(struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self); /* proto */
2569 static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self); /* proto */
2570 static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2571 static PyObject *__pyx_pf_10csmoothers_jacobi_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M); /* proto */
2572 static PyObject *__pyx_pf_10csmoothers_2jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX); /* proto */
2573 static PyObject *__pyx_pf_10csmoothers_4nl_jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX); /* proto */
2574 static PyObject *__pyx_pf_10csmoothers_6gauss_seidel_NR_preare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M); /* proto */
2575 static PyObject *__pyx_pf_10csmoothers_8gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX); /* proto */
2576 static PyObject *__pyx_pf_10csmoothers_10nl_gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX); /* proto */
2577 static PyObject *__pyx_pf_10csmoothers_12asm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_asmFactor); /* proto */
2578 static PyObject *__pyx_pf_10csmoothers_14asm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_asmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX); /* proto */
2579 static PyObject *__pyx_pf_10csmoothers_16basm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_basmFactor); /* proto */
2580 static PyObject *__pyx_pf_10csmoothers_18basm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_basmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX); /* proto */
2581 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2582 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
2583 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
2584 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2585 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2586 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2587 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2588 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
2589 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
2590 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
2591 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
2592 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2593 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
2594 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2595 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2596 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2597 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
2598 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2599 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
2600 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
2601 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2602 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2603 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2604 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2605 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2606 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2607 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2608 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2609 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2610 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2611 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2612 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2613 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2614 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2615 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2616 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2617 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2618 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2619 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2620 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2621 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2622 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2623 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2624 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2625 static PyObject *__pyx_tp_new_10csmoothers_cASMFactor(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2626 static PyObject *__pyx_tp_new_10csmoothers_cBASMFactor(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2627 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2628 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2629 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2630 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2631 static PyObject *__pyx_int_0;
2632 static PyObject *__pyx_int_1;
2633 static PyObject *__pyx_int_184977713;
2634 static PyObject *__pyx_int_neg_1;
2635 static PyObject *__pyx_tuple_;
2636 static PyObject *__pyx_tuple__2;
2637 static PyObject *__pyx_tuple__3;
2638 static PyObject *__pyx_tuple__4;
2639 static PyObject *__pyx_tuple__5;
2640 static PyObject *__pyx_tuple__6;
2641 static PyObject *__pyx_tuple__7;
2642 static PyObject *__pyx_tuple__8;
2643 static PyObject *__pyx_tuple__9;
2644 static PyObject *__pyx_slice__29;
2645 static PyObject *__pyx_slice__30;
2646 static PyObject *__pyx_slice__31;
2647 static PyObject *__pyx_tuple__10;
2648 static PyObject *__pyx_tuple__11;
2649 static PyObject *__pyx_tuple__12;
2650 static PyObject *__pyx_tuple__13;
2651 static PyObject *__pyx_tuple__14;
2652 static PyObject *__pyx_tuple__15;
2653 static PyObject *__pyx_tuple__16;
2654 static PyObject *__pyx_tuple__17;
2655 static PyObject *__pyx_tuple__18;
2656 static PyObject *__pyx_tuple__19;
2657 static PyObject *__pyx_tuple__20;
2658 static PyObject *__pyx_tuple__21;
2659 static PyObject *__pyx_tuple__22;
2660 static PyObject *__pyx_tuple__23;
2661 static PyObject *__pyx_tuple__24;
2662 static PyObject *__pyx_tuple__25;
2663 static PyObject *__pyx_tuple__26;
2664 static PyObject *__pyx_tuple__27;
2665 static PyObject *__pyx_tuple__28;
2666 static PyObject *__pyx_tuple__32;
2667 static PyObject *__pyx_tuple__33;
2668 static PyObject *__pyx_tuple__34;
2669 static PyObject *__pyx_tuple__35;
2670 static PyObject *__pyx_tuple__36;
2671 static PyObject *__pyx_tuple__38;
2672 static PyObject *__pyx_tuple__39;
2673 static PyObject *__pyx_tuple__41;
2674 static PyObject *__pyx_tuple__43;
2675 static PyObject *__pyx_tuple__45;
2676 static PyObject *__pyx_tuple__47;
2677 static PyObject *__pyx_tuple__49;
2678 static PyObject *__pyx_tuple__51;
2679 static PyObject *__pyx_tuple__53;
2680 static PyObject *__pyx_tuple__55;
2681 static PyObject *__pyx_tuple__57;
2682 static PyObject *__pyx_tuple__59;
2683 static PyObject *__pyx_tuple__61;
2684 static PyObject *__pyx_tuple__62;
2685 static PyObject *__pyx_tuple__63;
2686 static PyObject *__pyx_tuple__64;
2687 static PyObject *__pyx_tuple__65;
2688 static PyObject *__pyx_tuple__66;
2689 static PyObject *__pyx_codeobj__37;
2690 static PyObject *__pyx_codeobj__40;
2691 static PyObject *__pyx_codeobj__42;
2692 static PyObject *__pyx_codeobj__44;
2693 static PyObject *__pyx_codeobj__46;
2694 static PyObject *__pyx_codeobj__48;
2695 static PyObject *__pyx_codeobj__50;
2696 static PyObject *__pyx_codeobj__52;
2697 static PyObject *__pyx_codeobj__54;
2698 static PyObject *__pyx_codeobj__56;
2699 static PyObject *__pyx_codeobj__58;
2700 static PyObject *__pyx_codeobj__60;
2701 static PyObject *__pyx_codeobj__67;
2702 /* Late includes */
2703 
2704 /* "csmoothers.pyx":7
2705  * class ASMFactor(object):
2706  *
2707  * def __init__(self, L): # <<<<<<<<<<<<<<
2708  * self.L = L
2709  * self._cASMFactor = cASMFactor(self.L._cSparseMatrix)
2710  */
2711 
2712 /* Python wrapper */
2713 static PyObject *__pyx_pw_10csmoothers_9ASMFactor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2714 static PyMethodDef __pyx_mdef_10csmoothers_9ASMFactor_1__init__ = {"__init__", (PyCFunction)__pyx_pw_10csmoothers_9ASMFactor_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
2715 static PyObject *__pyx_pw_10csmoothers_9ASMFactor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2716  PyObject *__pyx_v_self = 0;
2717  PyObject *__pyx_v_L = 0;
2718  PyObject *__pyx_r = 0;
2719  __Pyx_RefNannyDeclarations
2720  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
2721  {
2722  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_L,0};
2723  PyObject* values[2] = {0,0};
2724  if (unlikely(__pyx_kwds)) {
2725  Py_ssize_t kw_args;
2726  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2727  switch (pos_args) {
2728  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2729  CYTHON_FALLTHROUGH;
2730  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2731  CYTHON_FALLTHROUGH;
2732  case 0: break;
2733  default: goto __pyx_L5_argtuple_error;
2734  }
2735  kw_args = PyDict_Size(__pyx_kwds);
2736  switch (pos_args) {
2737  case 0:
2738  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
2739  else goto __pyx_L5_argtuple_error;
2740  CYTHON_FALLTHROUGH;
2741  case 1:
2742  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_L)) != 0)) kw_args--;
2743  else {
2744  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 7, __pyx_L3_error)
2745  }
2746  }
2747  if (unlikely(kw_args > 0)) {
2748  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 7, __pyx_L3_error)
2749  }
2750  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
2751  goto __pyx_L5_argtuple_error;
2752  } else {
2753  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2754  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2755  }
2756  __pyx_v_self = values[0];
2757  __pyx_v_L = values[1];
2758  }
2759  goto __pyx_L4_argument_unpacking_done;
2760  __pyx_L5_argtuple_error:;
2761  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7, __pyx_L3_error)
2762  __pyx_L3_error:;
2763  __Pyx_AddTraceback("csmoothers.ASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2764  __Pyx_RefNannyFinishContext();
2765  return NULL;
2766  __pyx_L4_argument_unpacking_done:;
2767  __pyx_r = __pyx_pf_10csmoothers_9ASMFactor___init__(__pyx_self, __pyx_v_self, __pyx_v_L);
2768 
2769  /* function exit code */
2770  __Pyx_RefNannyFinishContext();
2771  return __pyx_r;
2772 }
2773 
2774 static PyObject *__pyx_pf_10csmoothers_9ASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L) {
2775  PyObject *__pyx_r = NULL;
2776  __Pyx_RefNannyDeclarations
2777  PyObject *__pyx_t_1 = NULL;
2778  PyObject *__pyx_t_2 = NULL;
2779  __Pyx_RefNannySetupContext("__init__", 0);
2780 
2781  /* "csmoothers.pyx":8
2782  *
2783  * def __init__(self, L):
2784  * self.L = L # <<<<<<<<<<<<<<
2785  * self._cASMFactor = cASMFactor(self.L._cSparseMatrix)
2786  *
2787  */
2788  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_L, __pyx_v_L) < 0) __PYX_ERR(0, 8, __pyx_L1_error)
2789 
2790  /* "csmoothers.pyx":9
2791  * def __init__(self, L):
2792  * self.L = L
2793  * self._cASMFactor = cASMFactor(self.L._cSparseMatrix) # <<<<<<<<<<<<<<
2794  *
2795  * cdef class cASMFactor(object):
2796  */
2797  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
2798  __Pyx_GOTREF(__pyx_t_1);
2799  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error)
2800  __Pyx_GOTREF(__pyx_t_2);
2801  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2802  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_10csmoothers_cASMFactor), __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
2803  __Pyx_GOTREF(__pyx_t_1);
2804  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2805  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cASMFactor, __pyx_t_1) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
2806  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2807 
2808  /* "csmoothers.pyx":7
2809  * class ASMFactor(object):
2810  *
2811  * def __init__(self, L): # <<<<<<<<<<<<<<
2812  * self.L = L
2813  * self._cASMFactor = cASMFactor(self.L._cSparseMatrix)
2814  */
2815 
2816  /* function exit code */
2817  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2818  goto __pyx_L0;
2819  __pyx_L1_error:;
2820  __Pyx_XDECREF(__pyx_t_1);
2821  __Pyx_XDECREF(__pyx_t_2);
2822  __Pyx_AddTraceback("csmoothers.ASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2823  __pyx_r = NULL;
2824  __pyx_L0:;
2825  __Pyx_XGIVEREF(__pyx_r);
2826  __Pyx_RefNannyFinishContext();
2827  return __pyx_r;
2828 }
2829 
2830 /* "csmoothers.pyx":13
2831  * cdef class cASMFactor(object):
2832  *
2833  * def __cinit__(self, # <<<<<<<<<<<<<<
2834  * superluWrappers.cSparseMatrix L):
2835  * cdef int rval = 0
2836  */
2837 
2838 /* Python wrapper */
2839 static int __pyx_pw_10csmoothers_10cASMFactor_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2840 static int __pyx_pw_10csmoothers_10cASMFactor_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2841  struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L = 0;
2842  int __pyx_r;
2843  __Pyx_RefNannyDeclarations
2844  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
2845  {
2846  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_L,0};
2847  PyObject* values[1] = {0};
2848  if (unlikely(__pyx_kwds)) {
2849  Py_ssize_t kw_args;
2850  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2851  switch (pos_args) {
2852  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2853  CYTHON_FALLTHROUGH;
2854  case 0: break;
2855  default: goto __pyx_L5_argtuple_error;
2856  }
2857  kw_args = PyDict_Size(__pyx_kwds);
2858  switch (pos_args) {
2859  case 0:
2860  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_L)) != 0)) kw_args--;
2861  else goto __pyx_L5_argtuple_error;
2862  }
2863  if (unlikely(kw_args > 0)) {
2864  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 13, __pyx_L3_error)
2865  }
2866  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
2867  goto __pyx_L5_argtuple_error;
2868  } else {
2869  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2870  }
2871  __pyx_v_L = ((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)values[0]);
2872  }
2873  goto __pyx_L4_argument_unpacking_done;
2874  __pyx_L5_argtuple_error:;
2875  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 13, __pyx_L3_error)
2876  __pyx_L3_error:;
2877  __Pyx_AddTraceback("csmoothers.cASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2878  __Pyx_RefNannyFinishContext();
2879  return -1;
2880  __pyx_L4_argument_unpacking_done:;
2881  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_L), __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix, 1, "L", 0))) __PYX_ERR(0, 14, __pyx_L1_error)
2882  __pyx_r = __pyx_pf_10csmoothers_10cASMFactor___cinit__(((struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self), __pyx_v_L);
2883 
2884  /* function exit code */
2885  goto __pyx_L0;
2886  __pyx_L1_error:;
2887  __pyx_r = -1;
2888  __pyx_L0:;
2889  __Pyx_RefNannyFinishContext();
2890  return __pyx_r;
2891 }
2892 
2893 static int __pyx_pf_10csmoothers_10cASMFactor___cinit__(struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self, struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L) {
2894  int __pyx_v_rval;
2895  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
2896  int __pyx_r;
2897  __Pyx_RefNannyDeclarations
2898  PyObject *__pyx_t_1 = NULL;
2899  int __pyx_t_2;
2900  __Pyx_RefNannySetupContext("__cinit__", 0);
2901 
2902  /* "csmoothers.pyx":15
2903  * def __cinit__(self,
2904  * superluWrappers.cSparseMatrix L):
2905  * cdef int rval = 0 # <<<<<<<<<<<<<<
2906  * cdef SuperMatrix AS
2907  * AS.Stype = superluWrappers._SLU_NR
2908  */
2909  __pyx_v_rval = 0;
2910 
2911  /* "csmoothers.pyx":17
2912  * cdef int rval = 0
2913  * cdef SuperMatrix AS
2914  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
2915  * AS.Dtype = superluWrappers._SLU_D
2916  * AS.Mtype = superluWrappers._SLU_GE
2917  */
2918  __pyx_v_AS.Stype = SLU_NR;
2919 
2920  /* "csmoothers.pyx":18
2921  * cdef SuperMatrix AS
2922  * AS.Stype = superluWrappers._SLU_NR
2923  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
2924  * AS.Mtype = superluWrappers._SLU_GE
2925  * AS.nrow = L.nr
2926  */
2927  __pyx_v_AS.Dtype = SLU_D;
2928 
2929  /* "csmoothers.pyx":19
2930  * AS.Stype = superluWrappers._SLU_NR
2931  * AS.Dtype = superluWrappers._SLU_D
2932  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
2933  * AS.nrow = L.nr
2934  * AS.ncol = L.nc
2935  */
2936  __pyx_v_AS.Mtype = SLU_GE;
2937 
2938  /* "csmoothers.pyx":20
2939  * AS.Dtype = superluWrappers._SLU_D
2940  * AS.Mtype = superluWrappers._SLU_GE
2941  * AS.nrow = L.nr # <<<<<<<<<<<<<<
2942  * AS.ncol = L.nc
2943  * AS.Store = &L.A
2944  */
2945  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
2946  __Pyx_GOTREF(__pyx_t_1);
2947  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 20, __pyx_L1_error)
2948  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2949  __pyx_v_AS.nrow = __pyx_t_2;
2950 
2951  /* "csmoothers.pyx":21
2952  * AS.Mtype = superluWrappers._SLU_GE
2953  * AS.nrow = L.nr
2954  * AS.ncol = L.nc # <<<<<<<<<<<<<<
2955  * AS.Store = &L.A
2956  * rval = casm_NR_init(&AS,
2957  */
2958  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
2959  __Pyx_GOTREF(__pyx_t_1);
2960  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 21, __pyx_L1_error)
2961  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2962  __pyx_v_AS.ncol = __pyx_t_2;
2963 
2964  /* "csmoothers.pyx":22
2965  * AS.nrow = L.nr
2966  * AS.ncol = L.nc
2967  * AS.Store = &L.A # <<<<<<<<<<<<<<
2968  * rval = casm_NR_init(&AS,
2969  * &self.subdomain_dim,
2970  */
2971  __pyx_v_AS.Store = (&__pyx_v_L->A);
2972 
2973  /* "csmoothers.pyx":23
2974  * AS.ncol = L.nc
2975  * AS.Store = &L.A
2976  * rval = casm_NR_init(&AS, # <<<<<<<<<<<<<<
2977  * &self.subdomain_dim,
2978  * &self.l2g_L,
2979  */
2980  __pyx_v_rval = asm_NR_init((&__pyx_v_AS), (&__pyx_v_self->subdomain_dim), (&__pyx_v_self->l2g_L), (&__pyx_v_self->subdomain_L), (&__pyx_v_self->subdomain_R), (&__pyx_v_self->subdomain_dX), (&__pyx_v_self->subdomain_pivots));
2981 
2982  /* "csmoothers.pyx":30
2983  * &self.subdomain_dX,
2984  * &self.subdomain_pivots)
2985  * assert rval == 0 # <<<<<<<<<<<<<<
2986  *
2987  * def __dealloc__(self):
2988  */
2989  #ifndef CYTHON_WITHOUT_ASSERTIONS
2990  if (unlikely(!Py_OptimizeFlag)) {
2991  if (unlikely(!((__pyx_v_rval == 0) != 0))) {
2992  PyErr_SetNone(PyExc_AssertionError);
2993  __PYX_ERR(0, 30, __pyx_L1_error)
2994  }
2995  }
2996  #endif
2997 
2998  /* "csmoothers.pyx":13
2999  * cdef class cASMFactor(object):
3000  *
3001  * def __cinit__(self, # <<<<<<<<<<<<<<
3002  * superluWrappers.cSparseMatrix L):
3003  * cdef int rval = 0
3004  */
3005 
3006  /* function exit code */
3007  __pyx_r = 0;
3008  goto __pyx_L0;
3009  __pyx_L1_error:;
3010  __Pyx_XDECREF(__pyx_t_1);
3011  __Pyx_AddTraceback("csmoothers.cASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3012  __pyx_r = -1;
3013  __pyx_L0:;
3014  __Pyx_RefNannyFinishContext();
3015  return __pyx_r;
3016 }
3017 
3018 /* "csmoothers.pyx":32
3019  * assert rval == 0
3020  *
3021  * def __dealloc__(self): # <<<<<<<<<<<<<<
3022  * casm_NR_free(self.N,
3023  * self.subdomain_dim,
3024  */
3025 
3026 /* Python wrapper */
3027 static void __pyx_pw_10csmoothers_10cASMFactor_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
3028 static void __pyx_pw_10csmoothers_10cASMFactor_3__dealloc__(PyObject *__pyx_v_self) {
3029  __Pyx_RefNannyDeclarations
3030  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
3031  __pyx_pf_10csmoothers_10cASMFactor_2__dealloc__(((struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self));
3032 
3033  /* function exit code */
3034  __Pyx_RefNannyFinishContext();
3035 }
3036 
3037 static void __pyx_pf_10csmoothers_10cASMFactor_2__dealloc__(struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self) {
3038  __Pyx_RefNannyDeclarations
3039  __Pyx_RefNannySetupContext("__dealloc__", 0);
3040 
3041  /* "csmoothers.pyx":33
3042  *
3043  * def __dealloc__(self):
3044  * casm_NR_free(self.N, # <<<<<<<<<<<<<<
3045  * self.subdomain_dim,
3046  * self.l2g_L,
3047  */
3048  asm_NR_free(__pyx_v_self->N, __pyx_v_self->subdomain_dim, __pyx_v_self->l2g_L, __pyx_v_self->subdomain_L, __pyx_v_self->subdomain_R, __pyx_v_self->subdomain_dX, __pyx_v_self->subdomain_pivots);
3049 
3050  /* "csmoothers.pyx":32
3051  * assert rval == 0
3052  *
3053  * def __dealloc__(self): # <<<<<<<<<<<<<<
3054  * casm_NR_free(self.N,
3055  * self.subdomain_dim,
3056  */
3057 
3058  /* function exit code */
3059  __Pyx_RefNannyFinishContext();
3060 }
3061 
3062 /* "(tree fragment)":1
3063  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3064  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3065  * def __setstate_cython__(self, __pyx_state):
3066  */
3067 
3068 /* Python wrapper */
3069 static PyObject *__pyx_pw_10csmoothers_10cASMFactor_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
3070 static PyObject *__pyx_pw_10csmoothers_10cASMFactor_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3071  PyObject *__pyx_r = 0;
3072  __Pyx_RefNannyDeclarations
3073  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
3074  __pyx_r = __pyx_pf_10csmoothers_10cASMFactor_4__reduce_cython__(((struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self));
3075 
3076  /* function exit code */
3077  __Pyx_RefNannyFinishContext();
3078  return __pyx_r;
3079 }
3080 
3081 static PyObject *__pyx_pf_10csmoothers_10cASMFactor_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self) {
3082  PyObject *__pyx_r = NULL;
3083  __Pyx_RefNannyDeclarations
3084  PyObject *__pyx_t_1 = NULL;
3085  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
3086 
3087  /* "(tree fragment)":2
3088  * def __reduce_cython__(self):
3089  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3090  * def __setstate_cython__(self, __pyx_state):
3091  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3092  */
3093  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
3094  __Pyx_GOTREF(__pyx_t_1);
3095  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3096  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3097  __PYX_ERR(1, 2, __pyx_L1_error)
3098 
3099  /* "(tree fragment)":1
3100  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3101  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3102  * def __setstate_cython__(self, __pyx_state):
3103  */
3104 
3105  /* function exit code */
3106  __pyx_L1_error:;
3107  __Pyx_XDECREF(__pyx_t_1);
3108  __Pyx_AddTraceback("csmoothers.cASMFactor.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3109  __pyx_r = NULL;
3110  __Pyx_XGIVEREF(__pyx_r);
3111  __Pyx_RefNannyFinishContext();
3112  return __pyx_r;
3113 }
3114 
3115 /* "(tree fragment)":3
3116  * def __reduce_cython__(self):
3117  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3118  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3119  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3120  */
3121 
3122 /* Python wrapper */
3123 static PyObject *__pyx_pw_10csmoothers_10cASMFactor_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
3124 static PyObject *__pyx_pw_10csmoothers_10cASMFactor_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
3125  PyObject *__pyx_r = 0;
3126  __Pyx_RefNannyDeclarations
3127  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
3128  __pyx_r = __pyx_pf_10csmoothers_10cASMFactor_6__setstate_cython__(((struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
3129 
3130  /* function exit code */
3131  __Pyx_RefNannyFinishContext();
3132  return __pyx_r;
3133 }
3134 
3135 static PyObject *__pyx_pf_10csmoothers_10cASMFactor_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
3136  PyObject *__pyx_r = NULL;
3137  __Pyx_RefNannyDeclarations
3138  PyObject *__pyx_t_1 = NULL;
3139  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
3140 
3141  /* "(tree fragment)":4
3142  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3143  * def __setstate_cython__(self, __pyx_state):
3144  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3145  */
3146  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
3147  __Pyx_GOTREF(__pyx_t_1);
3148  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3149  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3150  __PYX_ERR(1, 4, __pyx_L1_error)
3151 
3152  /* "(tree fragment)":3
3153  * def __reduce_cython__(self):
3154  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3155  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3156  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3157  */
3158 
3159  /* function exit code */
3160  __pyx_L1_error:;
3161  __Pyx_XDECREF(__pyx_t_1);
3162  __Pyx_AddTraceback("csmoothers.cASMFactor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3163  __pyx_r = NULL;
3164  __Pyx_XGIVEREF(__pyx_r);
3165  __Pyx_RefNannyFinishContext();
3166  return __pyx_r;
3167 }
3168 
3169 /* "csmoothers.pyx":44
3170  * class BASMFactor(object):
3171  *
3172  * def __init__(self, L, bs): # <<<<<<<<<<<<<<
3173  * self.L = L
3174  * self.bs = bs
3175  */
3176 
3177 /* Python wrapper */
3178 static PyObject *__pyx_pw_10csmoothers_10BASMFactor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3179 static PyMethodDef __pyx_mdef_10csmoothers_10BASMFactor_1__init__ = {"__init__", (PyCFunction)__pyx_pw_10csmoothers_10BASMFactor_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
3180 static PyObject *__pyx_pw_10csmoothers_10BASMFactor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3181  PyObject *__pyx_v_self = 0;
3182  PyObject *__pyx_v_L = 0;
3183  PyObject *__pyx_v_bs = 0;
3184  PyObject *__pyx_r = 0;
3185  __Pyx_RefNannyDeclarations
3186  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
3187  {
3188  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_L,&__pyx_n_s_bs,0};
3189  PyObject* values[3] = {0,0,0};
3190  if (unlikely(__pyx_kwds)) {
3191  Py_ssize_t kw_args;
3192  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3193  switch (pos_args) {
3194  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3195  CYTHON_FALLTHROUGH;
3196  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3197  CYTHON_FALLTHROUGH;
3198  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3199  CYTHON_FALLTHROUGH;
3200  case 0: break;
3201  default: goto __pyx_L5_argtuple_error;
3202  }
3203  kw_args = PyDict_Size(__pyx_kwds);
3204  switch (pos_args) {
3205  case 0:
3206  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
3207  else goto __pyx_L5_argtuple_error;
3208  CYTHON_FALLTHROUGH;
3209  case 1:
3210  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_L)) != 0)) kw_args--;
3211  else {
3212  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 44, __pyx_L3_error)
3213  }
3214  CYTHON_FALLTHROUGH;
3215  case 2:
3216  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bs)) != 0)) kw_args--;
3217  else {
3218  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 44, __pyx_L3_error)
3219  }
3220  }
3221  if (unlikely(kw_args > 0)) {
3222  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 44, __pyx_L3_error)
3223  }
3224  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
3225  goto __pyx_L5_argtuple_error;
3226  } else {
3227  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3228  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3229  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3230  }
3231  __pyx_v_self = values[0];
3232  __pyx_v_L = values[1];
3233  __pyx_v_bs = values[2];
3234  }
3235  goto __pyx_L4_argument_unpacking_done;
3236  __pyx_L5_argtuple_error:;
3237  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 44, __pyx_L3_error)
3238  __pyx_L3_error:;
3239  __Pyx_AddTraceback("csmoothers.BASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3240  __Pyx_RefNannyFinishContext();
3241  return NULL;
3242  __pyx_L4_argument_unpacking_done:;
3243  __pyx_r = __pyx_pf_10csmoothers_10BASMFactor___init__(__pyx_self, __pyx_v_self, __pyx_v_L, __pyx_v_bs);
3244 
3245  /* function exit code */
3246  __Pyx_RefNannyFinishContext();
3247  return __pyx_r;
3248 }
3249 
3250 static PyObject *__pyx_pf_10csmoothers_10BASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L, PyObject *__pyx_v_bs) {
3251  PyObject *__pyx_r = NULL;
3252  __Pyx_RefNannyDeclarations
3253  PyObject *__pyx_t_1 = NULL;
3254  PyObject *__pyx_t_2 = NULL;
3255  PyObject *__pyx_t_3 = NULL;
3256  __Pyx_RefNannySetupContext("__init__", 0);
3257 
3258  /* "csmoothers.pyx":45
3259  *
3260  * def __init__(self, L, bs):
3261  * self.L = L # <<<<<<<<<<<<<<
3262  * self.bs = bs
3263  * self._cBASMFactor = cBASMFactor(self.L._cSparseMatrix,
3264  */
3265  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_L, __pyx_v_L) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
3266 
3267  /* "csmoothers.pyx":46
3268  * def __init__(self, L, bs):
3269  * self.L = L
3270  * self.bs = bs # <<<<<<<<<<<<<<
3271  * self._cBASMFactor = cBASMFactor(self.L._cSparseMatrix,
3272  * self.bs)
3273  */
3274  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_bs, __pyx_v_bs) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
3275 
3276  /* "csmoothers.pyx":47
3277  * self.L = L
3278  * self.bs = bs
3279  * self._cBASMFactor = cBASMFactor(self.L._cSparseMatrix, # <<<<<<<<<<<<<<
3280  * self.bs)
3281  *
3282  */
3283  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
3284  __Pyx_GOTREF(__pyx_t_1);
3285  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error)
3286  __Pyx_GOTREF(__pyx_t_2);
3287  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3288 
3289  /* "csmoothers.pyx":48
3290  * self.bs = bs
3291  * self._cBASMFactor = cBASMFactor(self.L._cSparseMatrix,
3292  * self.bs) # <<<<<<<<<<<<<<
3293  *
3294  * cdef class cBASMFactor(object):
3295  */
3296  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error)
3297  __Pyx_GOTREF(__pyx_t_1);
3298 
3299  /* "csmoothers.pyx":47
3300  * self.L = L
3301  * self.bs = bs
3302  * self._cBASMFactor = cBASMFactor(self.L._cSparseMatrix, # <<<<<<<<<<<<<<
3303  * self.bs)
3304  *
3305  */
3306  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 47, __pyx_L1_error)
3307  __Pyx_GOTREF(__pyx_t_3);
3308  __Pyx_GIVEREF(__pyx_t_2);
3309  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
3310  __Pyx_GIVEREF(__pyx_t_1);
3311  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
3312  __pyx_t_2 = 0;
3313  __pyx_t_1 = 0;
3314  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_10csmoothers_cBASMFactor), __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
3315  __Pyx_GOTREF(__pyx_t_1);
3316  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3317  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cBASMFactor, __pyx_t_1) < 0) __PYX_ERR(0, 47, __pyx_L1_error)
3318  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3319 
3320  /* "csmoothers.pyx":44
3321  * class BASMFactor(object):
3322  *
3323  * def __init__(self, L, bs): # <<<<<<<<<<<<<<
3324  * self.L = L
3325  * self.bs = bs
3326  */
3327 
3328  /* function exit code */
3329  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3330  goto __pyx_L0;
3331  __pyx_L1_error:;
3332  __Pyx_XDECREF(__pyx_t_1);
3333  __Pyx_XDECREF(__pyx_t_2);
3334  __Pyx_XDECREF(__pyx_t_3);
3335  __Pyx_AddTraceback("csmoothers.BASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3336  __pyx_r = NULL;
3337  __pyx_L0:;
3338  __Pyx_XGIVEREF(__pyx_r);
3339  __Pyx_RefNannyFinishContext();
3340  return __pyx_r;
3341 }
3342 
3343 /* "csmoothers.pyx":52
3344  * cdef class cBASMFactor(object):
3345  *
3346  * def __cinit__(self, # <<<<<<<<<<<<<<
3347  * superluWrappers.cSparseMatrix L,
3348  * int bs):
3349  */
3350 
3351 /* Python wrapper */
3352 static int __pyx_pw_10csmoothers_11cBASMFactor_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3353 static int __pyx_pw_10csmoothers_11cBASMFactor_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3354  struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L = 0;
3355  int __pyx_v_bs;
3356  int __pyx_r;
3357  __Pyx_RefNannyDeclarations
3358  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
3359  {
3360  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_L,&__pyx_n_s_bs,0};
3361  PyObject* values[2] = {0,0};
3362  if (unlikely(__pyx_kwds)) {
3363  Py_ssize_t kw_args;
3364  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3365  switch (pos_args) {
3366  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3367  CYTHON_FALLTHROUGH;
3368  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3369  CYTHON_FALLTHROUGH;
3370  case 0: break;
3371  default: goto __pyx_L5_argtuple_error;
3372  }
3373  kw_args = PyDict_Size(__pyx_kwds);
3374  switch (pos_args) {
3375  case 0:
3376  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_L)) != 0)) kw_args--;
3377  else goto __pyx_L5_argtuple_error;
3378  CYTHON_FALLTHROUGH;
3379  case 1:
3380  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bs)) != 0)) kw_args--;
3381  else {
3382  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); __PYX_ERR(0, 52, __pyx_L3_error)
3383  }
3384  }
3385  if (unlikely(kw_args > 0)) {
3386  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 52, __pyx_L3_error)
3387  }
3388  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
3389  goto __pyx_L5_argtuple_error;
3390  } else {
3391  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3392  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3393  }
3394  __pyx_v_L = ((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)values[0]);
3395  __pyx_v_bs = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_bs == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error)
3396  }
3397  goto __pyx_L4_argument_unpacking_done;
3398  __pyx_L5_argtuple_error:;
3399  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 52, __pyx_L3_error)
3400  __pyx_L3_error:;
3401  __Pyx_AddTraceback("csmoothers.cBASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3402  __Pyx_RefNannyFinishContext();
3403  return -1;
3404  __pyx_L4_argument_unpacking_done:;
3405  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_L), __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix, 1, "L", 0))) __PYX_ERR(0, 53, __pyx_L1_error)
3406  __pyx_r = __pyx_pf_10csmoothers_11cBASMFactor___cinit__(((struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self), __pyx_v_L, __pyx_v_bs);
3407 
3408  /* function exit code */
3409  goto __pyx_L0;
3410  __pyx_L1_error:;
3411  __pyx_r = -1;
3412  __pyx_L0:;
3413  __Pyx_RefNannyFinishContext();
3414  return __pyx_r;
3415 }
3416 
3417 static int __pyx_pf_10csmoothers_11cBASMFactor___cinit__(struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self, struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L, int __pyx_v_bs) {
3418  int __pyx_v_rval;
3419  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
3420  int __pyx_r;
3421  __Pyx_RefNannyDeclarations
3422  PyObject *__pyx_t_1 = NULL;
3423  int __pyx_t_2;
3424  __Pyx_RefNannySetupContext("__cinit__", 0);
3425 
3426  /* "csmoothers.pyx":55
3427  * superluWrappers.cSparseMatrix L,
3428  * int bs):
3429  * cdef int rval = 0 # <<<<<<<<<<<<<<
3430  * cdef SuperMatrix AS
3431  * AS.Stype = superluWrappers._SLU_NR
3432  */
3433  __pyx_v_rval = 0;
3434 
3435  /* "csmoothers.pyx":57
3436  * cdef int rval = 0
3437  * cdef SuperMatrix AS
3438  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
3439  * AS.Dtype = superluWrappers._SLU_D
3440  * AS.Mtype = superluWrappers._SLU_GE
3441  */
3442  __pyx_v_AS.Stype = SLU_NR;
3443 
3444  /* "csmoothers.pyx":58
3445  * cdef SuperMatrix AS
3446  * AS.Stype = superluWrappers._SLU_NR
3447  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
3448  * AS.Mtype = superluWrappers._SLU_GE
3449  * AS.nrow = L.nr
3450  */
3451  __pyx_v_AS.Dtype = SLU_D;
3452 
3453  /* "csmoothers.pyx":59
3454  * AS.Stype = superluWrappers._SLU_NR
3455  * AS.Dtype = superluWrappers._SLU_D
3456  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
3457  * AS.nrow = L.nr
3458  * AS.ncol = L.nc
3459  */
3460  __pyx_v_AS.Mtype = SLU_GE;
3461 
3462  /* "csmoothers.pyx":60
3463  * AS.Dtype = superluWrappers._SLU_D
3464  * AS.Mtype = superluWrappers._SLU_GE
3465  * AS.nrow = L.nr # <<<<<<<<<<<<<<
3466  * AS.ncol = L.nc
3467  * AS.Store = &L.A
3468  */
3469  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error)
3470  __Pyx_GOTREF(__pyx_t_1);
3471  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 60, __pyx_L1_error)
3472  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3473  __pyx_v_AS.nrow = __pyx_t_2;
3474 
3475  /* "csmoothers.pyx":61
3476  * AS.Mtype = superluWrappers._SLU_GE
3477  * AS.nrow = L.nr
3478  * AS.ncol = L.nc # <<<<<<<<<<<<<<
3479  * AS.Store = &L.A
3480  * rval = cbasm_NR_init(bs,
3481  */
3482  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error)
3483  __Pyx_GOTREF(__pyx_t_1);
3484  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L1_error)
3485  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3486  __pyx_v_AS.ncol = __pyx_t_2;
3487 
3488  /* "csmoothers.pyx":62
3489  * AS.nrow = L.nr
3490  * AS.ncol = L.nc
3491  * AS.Store = &L.A # <<<<<<<<<<<<<<
3492  * rval = cbasm_NR_init(bs,
3493  * &AS,
3494  */
3495  __pyx_v_AS.Store = (&__pyx_v_L->A);
3496 
3497  /* "csmoothers.pyx":63
3498  * AS.ncol = L.nc
3499  * AS.Store = &L.A
3500  * rval = cbasm_NR_init(bs, # <<<<<<<<<<<<<<
3501  * &AS,
3502  * &self.subdomain_dim,
3503  */
3504  __pyx_v_rval = basm_NR_init(__pyx_v_bs, (&__pyx_v_AS), (&__pyx_v_self->subdomain_dim), (&__pyx_v_self->l2g_L), (&__pyx_v_self->subdomain_L), (&__pyx_v_self->subdomain_R), (&__pyx_v_self->subdomain_dX), (&__pyx_v_self->subdomain_pivots), (&__pyx_v_self->subdomain_col_pivots));
3505 
3506  /* "csmoothers.pyx":72
3507  * &self.subdomain_pivots,
3508  * &self.subdomain_col_pivots)
3509  * assert rval == 0 # <<<<<<<<<<<<<<
3510  *
3511  * def __dealloc__(self):
3512  */
3513  #ifndef CYTHON_WITHOUT_ASSERTIONS
3514  if (unlikely(!Py_OptimizeFlag)) {
3515  if (unlikely(!((__pyx_v_rval == 0) != 0))) {
3516  PyErr_SetNone(PyExc_AssertionError);
3517  __PYX_ERR(0, 72, __pyx_L1_error)
3518  }
3519  }
3520  #endif
3521 
3522  /* "csmoothers.pyx":52
3523  * cdef class cBASMFactor(object):
3524  *
3525  * def __cinit__(self, # <<<<<<<<<<<<<<
3526  * superluWrappers.cSparseMatrix L,
3527  * int bs):
3528  */
3529 
3530  /* function exit code */
3531  __pyx_r = 0;
3532  goto __pyx_L0;
3533  __pyx_L1_error:;
3534  __Pyx_XDECREF(__pyx_t_1);
3535  __Pyx_AddTraceback("csmoothers.cBASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3536  __pyx_r = -1;
3537  __pyx_L0:;
3538  __Pyx_RefNannyFinishContext();
3539  return __pyx_r;
3540 }
3541 
3542 /* "csmoothers.pyx":74
3543  * assert rval == 0
3544  *
3545  * def __dealloc__(self): # <<<<<<<<<<<<<<
3546  * cbasm_NR_free(self.N,
3547  * self.subdomain_dim,
3548  */
3549 
3550 /* Python wrapper */
3551 static void __pyx_pw_10csmoothers_11cBASMFactor_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
3552 static void __pyx_pw_10csmoothers_11cBASMFactor_3__dealloc__(PyObject *__pyx_v_self) {
3553  __Pyx_RefNannyDeclarations
3554  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
3555  __pyx_pf_10csmoothers_11cBASMFactor_2__dealloc__(((struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self));
3556 
3557  /* function exit code */
3558  __Pyx_RefNannyFinishContext();
3559 }
3560 
3561 static void __pyx_pf_10csmoothers_11cBASMFactor_2__dealloc__(struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self) {
3562  __Pyx_RefNannyDeclarations
3563  __Pyx_RefNannySetupContext("__dealloc__", 0);
3564 
3565  /* "csmoothers.pyx":75
3566  *
3567  * def __dealloc__(self):
3568  * cbasm_NR_free(self.N, # <<<<<<<<<<<<<<
3569  * self.subdomain_dim,
3570  * self.l2g_L,
3571  */
3572  basm_NR_free(__pyx_v_self->N, __pyx_v_self->subdomain_dim, __pyx_v_self->l2g_L, __pyx_v_self->subdomain_L, __pyx_v_self->subdomain_R, __pyx_v_self->subdomain_dX, __pyx_v_self->subdomain_pivots, __pyx_v_self->subdomain_col_pivots);
3573 
3574  /* "csmoothers.pyx":74
3575  * assert rval == 0
3576  *
3577  * def __dealloc__(self): # <<<<<<<<<<<<<<
3578  * cbasm_NR_free(self.N,
3579  * self.subdomain_dim,
3580  */
3581 
3582  /* function exit code */
3583  __Pyx_RefNannyFinishContext();
3584 }
3585 
3586 /* "(tree fragment)":1
3587  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3588  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3589  * def __setstate_cython__(self, __pyx_state):
3590  */
3591 
3592 /* Python wrapper */
3593 static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
3594 static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3595  PyObject *__pyx_r = 0;
3596  __Pyx_RefNannyDeclarations
3597  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
3598  __pyx_r = __pyx_pf_10csmoothers_11cBASMFactor_4__reduce_cython__(((struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self));
3599 
3600  /* function exit code */
3601  __Pyx_RefNannyFinishContext();
3602  return __pyx_r;
3603 }
3604 
3605 static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self) {
3606  PyObject *__pyx_r = NULL;
3607  __Pyx_RefNannyDeclarations
3608  PyObject *__pyx_t_1 = NULL;
3609  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
3610 
3611  /* "(tree fragment)":2
3612  * def __reduce_cython__(self):
3613  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3614  * def __setstate_cython__(self, __pyx_state):
3615  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3616  */
3617  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
3618  __Pyx_GOTREF(__pyx_t_1);
3619  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3620  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3621  __PYX_ERR(1, 2, __pyx_L1_error)
3622 
3623  /* "(tree fragment)":1
3624  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3625  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3626  * def __setstate_cython__(self, __pyx_state):
3627  */
3628 
3629  /* function exit code */
3630  __pyx_L1_error:;
3631  __Pyx_XDECREF(__pyx_t_1);
3632  __Pyx_AddTraceback("csmoothers.cBASMFactor.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3633  __pyx_r = NULL;
3634  __Pyx_XGIVEREF(__pyx_r);
3635  __Pyx_RefNannyFinishContext();
3636  return __pyx_r;
3637 }
3638 
3639 /* "(tree fragment)":3
3640  * def __reduce_cython__(self):
3641  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3642  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3643  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3644  */
3645 
3646 /* Python wrapper */
3647 static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
3648 static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
3649  PyObject *__pyx_r = 0;
3650  __Pyx_RefNannyDeclarations
3651  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
3652  __pyx_r = __pyx_pf_10csmoothers_11cBASMFactor_6__setstate_cython__(((struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
3653 
3654  /* function exit code */
3655  __Pyx_RefNannyFinishContext();
3656  return __pyx_r;
3657 }
3658 
3659 static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
3660  PyObject *__pyx_r = NULL;
3661  __Pyx_RefNannyDeclarations
3662  PyObject *__pyx_t_1 = NULL;
3663  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
3664 
3665  /* "(tree fragment)":4
3666  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3667  * def __setstate_cython__(self, __pyx_state):
3668  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3669  */
3670  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
3671  __Pyx_GOTREF(__pyx_t_1);
3672  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3673  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3674  __PYX_ERR(1, 4, __pyx_L1_error)
3675 
3676  /* "(tree fragment)":3
3677  * def __reduce_cython__(self):
3678  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3679  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3680  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3681  */
3682 
3683  /* function exit code */
3684  __pyx_L1_error:;
3685  __Pyx_XDECREF(__pyx_t_1);
3686  __Pyx_AddTraceback("csmoothers.cBASMFactor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3687  __pyx_r = NULL;
3688  __Pyx_XGIVEREF(__pyx_r);
3689  __Pyx_RefNannyFinishContext();
3690  return __pyx_r;
3691 }
3692 
3693 /* "csmoothers.pyx":84
3694  * self.subdomain_col_pivots)
3695  *
3696  * def jacobi_NR_prepare(A, w, tol, M): # <<<<<<<<<<<<<<
3697  * """
3698  *
3699  */
3700 
3701 /* Python wrapper */
3702 static PyObject *__pyx_pw_10csmoothers_1jacobi_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3703 static char __pyx_doc_10csmoothers_jacobi_NR_prepare[] = "\n\n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n w : double\n tol : double\n M : np.array\n ";
3704 static PyMethodDef __pyx_mdef_10csmoothers_1jacobi_NR_prepare = {"jacobi_NR_prepare", (PyCFunction)__pyx_pw_10csmoothers_1jacobi_NR_prepare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_jacobi_NR_prepare};
3705 static PyObject *__pyx_pw_10csmoothers_1jacobi_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3706  PyObject *__pyx_v_A = 0;
3707  PyObject *__pyx_v_w = 0;
3708  PyObject *__pyx_v_tol = 0;
3709  PyObject *__pyx_v_M = 0;
3710  PyObject *__pyx_r = 0;
3711  __Pyx_RefNannyDeclarations
3712  __Pyx_RefNannySetupContext("jacobi_NR_prepare (wrapper)", 0);
3713  {
3714  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_w,&__pyx_n_s_tol,&__pyx_n_s_M,0};
3715  PyObject* values[4] = {0,0,0,0};
3716  if (unlikely(__pyx_kwds)) {
3717  Py_ssize_t kw_args;
3718  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3719  switch (pos_args) {
3720  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3721  CYTHON_FALLTHROUGH;
3722  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3723  CYTHON_FALLTHROUGH;
3724  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3725  CYTHON_FALLTHROUGH;
3726  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3727  CYTHON_FALLTHROUGH;
3728  case 0: break;
3729  default: goto __pyx_L5_argtuple_error;
3730  }
3731  kw_args = PyDict_Size(__pyx_kwds);
3732  switch (pos_args) {
3733  case 0:
3734  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
3735  else goto __pyx_L5_argtuple_error;
3736  CYTHON_FALLTHROUGH;
3737  case 1:
3738  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
3739  else {
3740  __Pyx_RaiseArgtupleInvalid("jacobi_NR_prepare", 1, 4, 4, 1); __PYX_ERR(0, 84, __pyx_L3_error)
3741  }
3742  CYTHON_FALLTHROUGH;
3743  case 2:
3744  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
3745  else {
3746  __Pyx_RaiseArgtupleInvalid("jacobi_NR_prepare", 1, 4, 4, 2); __PYX_ERR(0, 84, __pyx_L3_error)
3747  }
3748  CYTHON_FALLTHROUGH;
3749  case 3:
3750  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_M)) != 0)) kw_args--;
3751  else {
3752  __Pyx_RaiseArgtupleInvalid("jacobi_NR_prepare", 1, 4, 4, 3); __PYX_ERR(0, 84, __pyx_L3_error)
3753  }
3754  }
3755  if (unlikely(kw_args > 0)) {
3756  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "jacobi_NR_prepare") < 0)) __PYX_ERR(0, 84, __pyx_L3_error)
3757  }
3758  } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
3759  goto __pyx_L5_argtuple_error;
3760  } else {
3761  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3762  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3763  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3764  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3765  }
3766  __pyx_v_A = values[0];
3767  __pyx_v_w = values[1];
3768  __pyx_v_tol = values[2];
3769  __pyx_v_M = values[3];
3770  }
3771  goto __pyx_L4_argument_unpacking_done;
3772  __pyx_L5_argtuple_error:;
3773  __Pyx_RaiseArgtupleInvalid("jacobi_NR_prepare", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 84, __pyx_L3_error)
3774  __pyx_L3_error:;
3775  __Pyx_AddTraceback("csmoothers.jacobi_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
3776  __Pyx_RefNannyFinishContext();
3777  return NULL;
3778  __pyx_L4_argument_unpacking_done:;
3779  __pyx_r = __pyx_pf_10csmoothers_jacobi_NR_prepare(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_tol, __pyx_v_M);
3780 
3781  /* function exit code */
3782  __Pyx_RefNannyFinishContext();
3783  return __pyx_r;
3784 }
3785 
3786 static PyObject *__pyx_pf_10csmoothers_jacobi_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M) {
3787  PyObject *__pyx_r = NULL;
3788  __Pyx_RefNannyDeclarations
3789  PyObject *__pyx_t_1 = NULL;
3790  double __pyx_t_2;
3791  double __pyx_t_3;
3792  __pyx_t_10csmoothers_DDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
3793  __Pyx_RefNannySetupContext("jacobi_NR_prepare", 0);
3794 
3795  /* "csmoothers.pyx":94
3796  * M : np.array
3797  * """
3798  * smootherWrappersjacobi_NR_prepare(A._cSparseMatrix, w, tol, M) # <<<<<<<<<<<<<<
3799  *
3800  * cdef void smootherWrappersjacobi_NR_prepare(superluWrappers.cSparseMatrix sm,
3801  */
3802  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error)
3803  __Pyx_GOTREF(__pyx_t_1);
3804  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 94, __pyx_L1_error)
3805  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_w); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L1_error)
3806  __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_tol); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L1_error)
3807  __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 94, __pyx_L1_error)
3808  __pyx_f_10csmoothers_smootherWrappersjacobi_NR_prepare(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4);
3809  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3810  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
3811  __pyx_t_4.memview = NULL;
3812  __pyx_t_4.data = NULL;
3813 
3814  /* "csmoothers.pyx":84
3815  * self.subdomain_col_pivots)
3816  *
3817  * def jacobi_NR_prepare(A, w, tol, M): # <<<<<<<<<<<<<<
3818  * """
3819  *
3820  */
3821 
3822  /* function exit code */
3823  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3824  goto __pyx_L0;
3825  __pyx_L1_error:;
3826  __Pyx_XDECREF(__pyx_t_1);
3827  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
3828  __Pyx_AddTraceback("csmoothers.jacobi_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
3829  __pyx_r = NULL;
3830  __pyx_L0:;
3831  __Pyx_XGIVEREF(__pyx_r);
3832  __Pyx_RefNannyFinishContext();
3833  return __pyx_r;
3834 }
3835 
3836 /* "csmoothers.pyx":96
3837  * smootherWrappersjacobi_NR_prepare(A._cSparseMatrix, w, tol, M)
3838  *
3839  * cdef void smootherWrappersjacobi_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
3840  * double w,
3841  * double tol,
3842  */
3843 
3844 static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, double __pyx_v_w, double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_M) {
3845  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
3846  __Pyx_RefNannyDeclarations
3847  PyObject *__pyx_t_1 = NULL;
3848  int __pyx_t_2;
3849  Py_ssize_t __pyx_t_3;
3850  __Pyx_RefNannySetupContext("smootherWrappersjacobi_NR_prepare", 0);
3851 
3852  /* "csmoothers.pyx":101
3853  * DDATA M):
3854  * cdef SuperMatrix AS
3855  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
3856  * AS.Dtype = superluWrappers._SLU_D
3857  * AS.Mtype = superluWrappers._SLU_GE
3858  */
3859  __pyx_v_AS.Stype = SLU_NR;
3860 
3861  /* "csmoothers.pyx":102
3862  * cdef SuperMatrix AS
3863  * AS.Stype = superluWrappers._SLU_NR
3864  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
3865  * AS.Mtype = superluWrappers._SLU_GE
3866  * AS.nrow = sm.nr
3867  */
3868  __pyx_v_AS.Dtype = SLU_D;
3869 
3870  /* "csmoothers.pyx":103
3871  * AS.Stype = superluWrappers._SLU_NR
3872  * AS.Dtype = superluWrappers._SLU_D
3873  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
3874  * AS.nrow = sm.nr
3875  * AS.ncol = sm.nc
3876  */
3877  __pyx_v_AS.Mtype = SLU_GE;
3878 
3879  /* "csmoothers.pyx":104
3880  * AS.Dtype = superluWrappers._SLU_D
3881  * AS.Mtype = superluWrappers._SLU_GE
3882  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
3883  * AS.ncol = sm.nc
3884  * AS.Store = &sm.A
3885  */
3886  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error)
3887  __Pyx_GOTREF(__pyx_t_1);
3888  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error)
3889  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3890  __pyx_v_AS.nrow = __pyx_t_2;
3891 
3892  /* "csmoothers.pyx":105
3893  * AS.Mtype = superluWrappers._SLU_GE
3894  * AS.nrow = sm.nr
3895  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
3896  * AS.Store = &sm.A
3897  * cjacobi_NR_prepare(&AS, w, tol, &M[0])
3898  */
3899  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error)
3900  __Pyx_GOTREF(__pyx_t_1);
3901  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L1_error)
3902  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3903  __pyx_v_AS.ncol = __pyx_t_2;
3904 
3905  /* "csmoothers.pyx":106
3906  * AS.nrow = sm.nr
3907  * AS.ncol = sm.nc
3908  * AS.Store = &sm.A # <<<<<<<<<<<<<<
3909  * cjacobi_NR_prepare(&AS, w, tol, &M[0])
3910  *
3911  */
3912  __pyx_v_AS.Store = (&__pyx_v_sm->A);
3913 
3914  /* "csmoothers.pyx":107
3915  * AS.ncol = sm.nc
3916  * AS.Store = &sm.A
3917  * cjacobi_NR_prepare(&AS, w, tol, &M[0]) # <<<<<<<<<<<<<<
3918  *
3919  * def jacobi_NR_solve(A, M, R, node_order, dX):
3920  */
3921  __pyx_t_3 = 0;
3922  __pyx_t_2 = -1;
3923  if (__pyx_t_3 < 0) {
3924  __pyx_t_3 += __pyx_v_M.shape[0];
3925  if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
3926  } else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
3927  if (unlikely(__pyx_t_2 != -1)) {
3928  __Pyx_RaiseBufferIndexError(__pyx_t_2);
3929  __PYX_ERR(0, 107, __pyx_L1_error)
3930  }
3931  jacobi_NR_prepare((&__pyx_v_AS), __pyx_v_w, __pyx_v_tol, (&(*((double *) ( /* dim=0 */ (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))));
3932 
3933  /* "csmoothers.pyx":96
3934  * smootherWrappersjacobi_NR_prepare(A._cSparseMatrix, w, tol, M)
3935  *
3936  * cdef void smootherWrappersjacobi_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
3937  * double w,
3938  * double tol,
3939  */
3940 
3941  /* function exit code */
3942  goto __pyx_L0;
3943  __pyx_L1_error:;
3944  __Pyx_XDECREF(__pyx_t_1);
3945  __Pyx_WriteUnraisable("csmoothers.smootherWrappersjacobi_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
3946  __pyx_L0:;
3947  __Pyx_RefNannyFinishContext();
3948 }
3949 
3950 /* "csmoothers.pyx":109
3951  * cjacobi_NR_prepare(&AS, w, tol, &M[0])
3952  *
3953  * def jacobi_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
3954  * """
3955  *
3956  */
3957 
3958 /* Python wrapper */
3959 static PyObject *__pyx_pw_10csmoothers_3jacobi_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3960 static char __pyx_doc_10csmoothers_2jacobi_NR_solve[] = "\n \n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n M : np.array double\n R : np.array double\n node_order : np.array int\n dX : np.array double\n ";
3961 static PyMethodDef __pyx_mdef_10csmoothers_3jacobi_NR_solve = {"jacobi_NR_solve", (PyCFunction)__pyx_pw_10csmoothers_3jacobi_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_2jacobi_NR_solve};
3962 static PyObject *__pyx_pw_10csmoothers_3jacobi_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3963  PyObject *__pyx_v_A = 0;
3964  PyObject *__pyx_v_M = 0;
3965  PyObject *__pyx_v_R = 0;
3966  PyObject *__pyx_v_node_order = 0;
3967  PyObject *__pyx_v_dX = 0;
3968  PyObject *__pyx_r = 0;
3969  __Pyx_RefNannyDeclarations
3970  __Pyx_RefNannySetupContext("jacobi_NR_solve (wrapper)", 0);
3971  {
3972  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_M,&__pyx_n_s_R,&__pyx_n_s_node_order,&__pyx_n_s_dX,0};
3973  PyObject* values[5] = {0,0,0,0,0};
3974  if (unlikely(__pyx_kwds)) {
3975  Py_ssize_t kw_args;
3976  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3977  switch (pos_args) {
3978  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3979  CYTHON_FALLTHROUGH;
3980  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3981  CYTHON_FALLTHROUGH;
3982  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3983  CYTHON_FALLTHROUGH;
3984  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3985  CYTHON_FALLTHROUGH;
3986  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3987  CYTHON_FALLTHROUGH;
3988  case 0: break;
3989  default: goto __pyx_L5_argtuple_error;
3990  }
3991  kw_args = PyDict_Size(__pyx_kwds);
3992  switch (pos_args) {
3993  case 0:
3994  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
3995  else goto __pyx_L5_argtuple_error;
3996  CYTHON_FALLTHROUGH;
3997  case 1:
3998  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_M)) != 0)) kw_args--;
3999  else {
4000  __Pyx_RaiseArgtupleInvalid("jacobi_NR_solve", 1, 5, 5, 1); __PYX_ERR(0, 109, __pyx_L3_error)
4001  }
4002  CYTHON_FALLTHROUGH;
4003  case 2:
4004  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
4005  else {
4006  __Pyx_RaiseArgtupleInvalid("jacobi_NR_solve", 1, 5, 5, 2); __PYX_ERR(0, 109, __pyx_L3_error)
4007  }
4008  CYTHON_FALLTHROUGH;
4009  case 3:
4010  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
4011  else {
4012  __Pyx_RaiseArgtupleInvalid("jacobi_NR_solve", 1, 5, 5, 3); __PYX_ERR(0, 109, __pyx_L3_error)
4013  }
4014  CYTHON_FALLTHROUGH;
4015  case 4:
4016  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
4017  else {
4018  __Pyx_RaiseArgtupleInvalid("jacobi_NR_solve", 1, 5, 5, 4); __PYX_ERR(0, 109, __pyx_L3_error)
4019  }
4020  }
4021  if (unlikely(kw_args > 0)) {
4022  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "jacobi_NR_solve") < 0)) __PYX_ERR(0, 109, __pyx_L3_error)
4023  }
4024  } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
4025  goto __pyx_L5_argtuple_error;
4026  } else {
4027  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4028  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4029  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4030  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4031  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4032  }
4033  __pyx_v_A = values[0];
4034  __pyx_v_M = values[1];
4035  __pyx_v_R = values[2];
4036  __pyx_v_node_order = values[3];
4037  __pyx_v_dX = values[4];
4038  }
4039  goto __pyx_L4_argument_unpacking_done;
4040  __pyx_L5_argtuple_error:;
4041  __Pyx_RaiseArgtupleInvalid("jacobi_NR_solve", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 109, __pyx_L3_error)
4042  __pyx_L3_error:;
4043  __Pyx_AddTraceback("csmoothers.jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4044  __Pyx_RefNannyFinishContext();
4045  return NULL;
4046  __pyx_L4_argument_unpacking_done:;
4047  __pyx_r = __pyx_pf_10csmoothers_2jacobi_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_M, __pyx_v_R, __pyx_v_node_order, __pyx_v_dX);
4048 
4049  /* function exit code */
4050  __Pyx_RefNannyFinishContext();
4051  return __pyx_r;
4052 }
4053 
4054 static PyObject *__pyx_pf_10csmoothers_2jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX) {
4055  PyObject *__pyx_r = NULL;
4056  __Pyx_RefNannyDeclarations
4057  PyObject *__pyx_t_1 = NULL;
4058  __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
4059  __pyx_t_10csmoothers_DDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
4060  __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
4061  __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
4062  __Pyx_RefNannySetupContext("jacobi_NR_solve", 0);
4063 
4064  /* "csmoothers.pyx":120
4065  * dX : np.array double
4066  * """
4067  * smootherWrappersjacobi_NR_solve(A._cSparseMatrix, M, R, node_order, dX) # <<<<<<<<<<<<<<
4068  *
4069  * cdef void smootherWrappersjacobi_NR_solve(superluWrappers.cSparseMatrix sm,
4070  */
4071  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error)
4072  __Pyx_GOTREF(__pyx_t_1);
4073  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 120, __pyx_L1_error)
4074  __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 120, __pyx_L1_error)
4075  __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 120, __pyx_L1_error)
4076  __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 120, __pyx_L1_error)
4077  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 120, __pyx_L1_error)
4078  __pyx_f_10csmoothers_smootherWrappersjacobi_NR_solve(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5);
4079  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4080  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4081  __pyx_t_2.memview = NULL;
4082  __pyx_t_2.data = NULL;
4083  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4084  __pyx_t_3.memview = NULL;
4085  __pyx_t_3.data = NULL;
4086  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4087  __pyx_t_4.memview = NULL;
4088  __pyx_t_4.data = NULL;
4089  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
4090  __pyx_t_5.memview = NULL;
4091  __pyx_t_5.data = NULL;
4092 
4093  /* "csmoothers.pyx":109
4094  * cjacobi_NR_prepare(&AS, w, tol, &M[0])
4095  *
4096  * def jacobi_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
4097  * """
4098  *
4099  */
4100 
4101  /* function exit code */
4102  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4103  goto __pyx_L0;
4104  __pyx_L1_error:;
4105  __Pyx_XDECREF(__pyx_t_1);
4106  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4107  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4108  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4109  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
4110  __Pyx_AddTraceback("csmoothers.jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4111  __pyx_r = NULL;
4112  __pyx_L0:;
4113  __Pyx_XGIVEREF(__pyx_r);
4114  __Pyx_RefNannyFinishContext();
4115  return __pyx_r;
4116 }
4117 
4118 /* "csmoothers.pyx":122
4119  * smootherWrappersjacobi_NR_solve(A._cSparseMatrix, M, R, node_order, dX)
4120  *
4121  * cdef void smootherWrappersjacobi_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
4122  * DDATA M,
4123  * DDATA R,
4124  */
4125 
4126 static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_M, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
4127  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
4128  __Pyx_RefNannyDeclarations
4129  PyObject *__pyx_t_1 = NULL;
4130  int __pyx_t_2;
4131  Py_ssize_t __pyx_t_3;
4132  Py_ssize_t __pyx_t_4;
4133  Py_ssize_t __pyx_t_5;
4134  Py_ssize_t __pyx_t_6;
4135  __Pyx_RefNannySetupContext("smootherWrappersjacobi_NR_solve", 0);
4136 
4137  /* "csmoothers.pyx":128
4138  * DDATA dX):
4139  * cdef SuperMatrix AS
4140  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
4141  * AS.Dtype = superluWrappers._SLU_D
4142  * AS.Mtype = superluWrappers._SLU_GE
4143  */
4144  __pyx_v_AS.Stype = SLU_NR;
4145 
4146  /* "csmoothers.pyx":129
4147  * cdef SuperMatrix AS
4148  * AS.Stype = superluWrappers._SLU_NR
4149  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
4150  * AS.Mtype = superluWrappers._SLU_GE
4151  * AS.nrow = sm.nr
4152  */
4153  __pyx_v_AS.Dtype = SLU_D;
4154 
4155  /* "csmoothers.pyx":130
4156  * AS.Stype = superluWrappers._SLU_NR
4157  * AS.Dtype = superluWrappers._SLU_D
4158  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
4159  * AS.nrow = sm.nr
4160  * AS.ncol = sm.nc
4161  */
4162  __pyx_v_AS.Mtype = SLU_GE;
4163 
4164  /* "csmoothers.pyx":131
4165  * AS.Dtype = superluWrappers._SLU_D
4166  * AS.Mtype = superluWrappers._SLU_GE
4167  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
4168  * AS.ncol = sm.nc
4169  * AS.Store = &sm.A
4170  */
4171  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error)
4172  __Pyx_GOTREF(__pyx_t_1);
4173  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 131, __pyx_L1_error)
4174  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4175  __pyx_v_AS.nrow = __pyx_t_2;
4176 
4177  /* "csmoothers.pyx":132
4178  * AS.Mtype = superluWrappers._SLU_GE
4179  * AS.nrow = sm.nr
4180  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
4181  * AS.Store = &sm.A
4182  * cjacobi_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
4183  */
4184  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error)
4185  __Pyx_GOTREF(__pyx_t_1);
4186  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error)
4187  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4188  __pyx_v_AS.ncol = __pyx_t_2;
4189 
4190  /* "csmoothers.pyx":133
4191  * AS.nrow = sm.nr
4192  * AS.ncol = sm.nc
4193  * AS.Store = &sm.A # <<<<<<<<<<<<<<
4194  * cjacobi_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
4195  *
4196  */
4197  __pyx_v_AS.Store = (&__pyx_v_sm->A);
4198 
4199  /* "csmoothers.pyx":134
4200  * AS.ncol = sm.nc
4201  * AS.Store = &sm.A
4202  * cjacobi_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0]) # <<<<<<<<<<<<<<
4203  *
4204  * def nl_jacobi_NR_solve(A, R, node_order, w, tol, dX):
4205  */
4206  __pyx_t_3 = 0;
4207  __pyx_t_2 = -1;
4208  if (__pyx_t_3 < 0) {
4209  __pyx_t_3 += __pyx_v_M.shape[0];
4210  if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
4211  } else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
4212  if (unlikely(__pyx_t_2 != -1)) {
4213  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4214  __PYX_ERR(0, 134, __pyx_L1_error)
4215  }
4216  __pyx_t_4 = 0;
4217  __pyx_t_2 = -1;
4218  if (__pyx_t_4 < 0) {
4219  __pyx_t_4 += __pyx_v_R.shape[0];
4220  if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
4221  } else if (unlikely(__pyx_t_4 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
4222  if (unlikely(__pyx_t_2 != -1)) {
4223  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4224  __PYX_ERR(0, 134, __pyx_L1_error)
4225  }
4226  __pyx_t_5 = 0;
4227  __pyx_t_2 = -1;
4228  if (__pyx_t_5 < 0) {
4229  __pyx_t_5 += __pyx_v_node_order.shape[0];
4230  if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
4231  } else if (unlikely(__pyx_t_5 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
4232  if (unlikely(__pyx_t_2 != -1)) {
4233  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4234  __PYX_ERR(0, 134, __pyx_L1_error)
4235  }
4236  __pyx_t_6 = 0;
4237  __pyx_t_2 = -1;
4238  if (__pyx_t_6 < 0) {
4239  __pyx_t_6 += __pyx_v_dX.shape[0];
4240  if (unlikely(__pyx_t_6 < 0)) __pyx_t_2 = 0;
4241  } else if (unlikely(__pyx_t_6 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
4242  if (unlikely(__pyx_t_2 != -1)) {
4243  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4244  __PYX_ERR(0, 134, __pyx_L1_error)
4245  }
4246  jacobi_NR_solve((&__pyx_v_AS), (&(*((double *) ( /* dim=0 */ (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_4 * __pyx_v_R.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_node_order.data + __pyx_t_5 * __pyx_v_node_order.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_dX.data + __pyx_t_6 * __pyx_v_dX.strides[0]) )))));
4247 
4248  /* "csmoothers.pyx":122
4249  * smootherWrappersjacobi_NR_solve(A._cSparseMatrix, M, R, node_order, dX)
4250  *
4251  * cdef void smootherWrappersjacobi_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
4252  * DDATA M,
4253  * DDATA R,
4254  */
4255 
4256  /* function exit code */
4257  goto __pyx_L0;
4258  __pyx_L1_error:;
4259  __Pyx_XDECREF(__pyx_t_1);
4260  __Pyx_WriteUnraisable("csmoothers.smootherWrappersjacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4261  __pyx_L0:;
4262  __Pyx_RefNannyFinishContext();
4263 }
4264 
4265 /* "csmoothers.pyx":136
4266  * cjacobi_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
4267  *
4268  * def nl_jacobi_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
4269  * """
4270  *
4271  */
4272 
4273 /* Python wrapper */
4274 static PyObject *__pyx_pw_10csmoothers_5nl_jacobi_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4275 static char __pyx_doc_10csmoothers_4nl_jacobi_NR_solve[] = "\n\n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n R : np.array double\n node_order : np.array int\n w : np.float\n tol : np.float\n dX : np.array double\n ";
4276 static PyMethodDef __pyx_mdef_10csmoothers_5nl_jacobi_NR_solve = {"nl_jacobi_NR_solve", (PyCFunction)__pyx_pw_10csmoothers_5nl_jacobi_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_4nl_jacobi_NR_solve};
4277 static PyObject *__pyx_pw_10csmoothers_5nl_jacobi_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4278  PyObject *__pyx_v_A = 0;
4279  PyObject *__pyx_v_R = 0;
4280  PyObject *__pyx_v_node_order = 0;
4281  PyObject *__pyx_v_w = 0;
4282  PyObject *__pyx_v_tol = 0;
4283  PyObject *__pyx_v_dX = 0;
4284  PyObject *__pyx_r = 0;
4285  __Pyx_RefNannyDeclarations
4286  __Pyx_RefNannySetupContext("nl_jacobi_NR_solve (wrapper)", 0);
4287  {
4288  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_R,&__pyx_n_s_node_order,&__pyx_n_s_w,&__pyx_n_s_tol,&__pyx_n_s_dX,0};
4289  PyObject* values[6] = {0,0,0,0,0,0};
4290  if (unlikely(__pyx_kwds)) {
4291  Py_ssize_t kw_args;
4292  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4293  switch (pos_args) {
4294  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4295  CYTHON_FALLTHROUGH;
4296  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4297  CYTHON_FALLTHROUGH;
4298  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4299  CYTHON_FALLTHROUGH;
4300  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4301  CYTHON_FALLTHROUGH;
4302  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4303  CYTHON_FALLTHROUGH;
4304  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4305  CYTHON_FALLTHROUGH;
4306  case 0: break;
4307  default: goto __pyx_L5_argtuple_error;
4308  }
4309  kw_args = PyDict_Size(__pyx_kwds);
4310  switch (pos_args) {
4311  case 0:
4312  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
4313  else goto __pyx_L5_argtuple_error;
4314  CYTHON_FALLTHROUGH;
4315  case 1:
4316  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
4317  else {
4318  __Pyx_RaiseArgtupleInvalid("nl_jacobi_NR_solve", 1, 6, 6, 1); __PYX_ERR(0, 136, __pyx_L3_error)
4319  }
4320  CYTHON_FALLTHROUGH;
4321  case 2:
4322  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
4323  else {
4324  __Pyx_RaiseArgtupleInvalid("nl_jacobi_NR_solve", 1, 6, 6, 2); __PYX_ERR(0, 136, __pyx_L3_error)
4325  }
4326  CYTHON_FALLTHROUGH;
4327  case 3:
4328  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
4329  else {
4330  __Pyx_RaiseArgtupleInvalid("nl_jacobi_NR_solve", 1, 6, 6, 3); __PYX_ERR(0, 136, __pyx_L3_error)
4331  }
4332  CYTHON_FALLTHROUGH;
4333  case 4:
4334  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
4335  else {
4336  __Pyx_RaiseArgtupleInvalid("nl_jacobi_NR_solve", 1, 6, 6, 4); __PYX_ERR(0, 136, __pyx_L3_error)
4337  }
4338  CYTHON_FALLTHROUGH;
4339  case 5:
4340  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
4341  else {
4342  __Pyx_RaiseArgtupleInvalid("nl_jacobi_NR_solve", 1, 6, 6, 5); __PYX_ERR(0, 136, __pyx_L3_error)
4343  }
4344  }
4345  if (unlikely(kw_args > 0)) {
4346  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "nl_jacobi_NR_solve") < 0)) __PYX_ERR(0, 136, __pyx_L3_error)
4347  }
4348  } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
4349  goto __pyx_L5_argtuple_error;
4350  } else {
4351  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4352  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4353  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4354  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4355  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4356  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4357  }
4358  __pyx_v_A = values[0];
4359  __pyx_v_R = values[1];
4360  __pyx_v_node_order = values[2];
4361  __pyx_v_w = values[3];
4362  __pyx_v_tol = values[4];
4363  __pyx_v_dX = values[5];
4364  }
4365  goto __pyx_L4_argument_unpacking_done;
4366  __pyx_L5_argtuple_error:;
4367  __Pyx_RaiseArgtupleInvalid("nl_jacobi_NR_solve", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 136, __pyx_L3_error)
4368  __pyx_L3_error:;
4369  __Pyx_AddTraceback("csmoothers.nl_jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4370  __Pyx_RefNannyFinishContext();
4371  return NULL;
4372  __pyx_L4_argument_unpacking_done:;
4373  __pyx_r = __pyx_pf_10csmoothers_4nl_jacobi_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_R, __pyx_v_node_order, __pyx_v_w, __pyx_v_tol, __pyx_v_dX);
4374 
4375  /* function exit code */
4376  __Pyx_RefNannyFinishContext();
4377  return __pyx_r;
4378 }
4379 
4380 static PyObject *__pyx_pf_10csmoothers_4nl_jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX) {
4381  PyObject *__pyx_r = NULL;
4382  __Pyx_RefNannyDeclarations
4383  PyObject *__pyx_t_1 = NULL;
4384  __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
4385  __pyx_t_10csmoothers_IDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
4386  double __pyx_t_4;
4387  double __pyx_t_5;
4388  __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
4389  __Pyx_RefNannySetupContext("nl_jacobi_NR_solve", 0);
4390 
4391  /* "csmoothers.pyx":148
4392  * dX : np.array double
4393  * """
4394  * smootherWrappersnl_jacobi_NR_solve(A._cSparseMatrix, R, node_order, w, tol, dX) # <<<<<<<<<<<<<<
4395  *
4396  * cdef void smootherWrappersnl_jacobi_NR_solve(superluWrappers.cSparseMatrix sm,
4397  */
4398  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
4399  __Pyx_GOTREF(__pyx_t_1);
4400  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 148, __pyx_L1_error)
4401  __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 148, __pyx_L1_error)
4402  __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 148, __pyx_L1_error)
4403  __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_w); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 148, __pyx_L1_error)
4404  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_tol); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 148, __pyx_L1_error)
4405  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 148, __pyx_L1_error)
4406  __pyx_f_10csmoothers_smootherWrappersnl_jacobi_NR_solve(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6);
4407  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4408  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4409  __pyx_t_2.memview = NULL;
4410  __pyx_t_2.data = NULL;
4411  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4412  __pyx_t_3.memview = NULL;
4413  __pyx_t_3.data = NULL;
4414  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
4415  __pyx_t_6.memview = NULL;
4416  __pyx_t_6.data = NULL;
4417 
4418  /* "csmoothers.pyx":136
4419  * cjacobi_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
4420  *
4421  * def nl_jacobi_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
4422  * """
4423  *
4424  */
4425 
4426  /* function exit code */
4427  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4428  goto __pyx_L0;
4429  __pyx_L1_error:;
4430  __Pyx_XDECREF(__pyx_t_1);
4431  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4432  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4433  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
4434  __Pyx_AddTraceback("csmoothers.nl_jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4435  __pyx_r = NULL;
4436  __pyx_L0:;
4437  __Pyx_XGIVEREF(__pyx_r);
4438  __Pyx_RefNannyFinishContext();
4439  return __pyx_r;
4440 }
4441 
4442 /* "csmoothers.pyx":150
4443  * smootherWrappersnl_jacobi_NR_solve(A._cSparseMatrix, R, node_order, w, tol, dX)
4444  *
4445  * cdef void smootherWrappersnl_jacobi_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
4446  * DDATA R,
4447  * IDATA node_order,
4448  */
4449 
4450 static void __pyx_f_10csmoothers_smootherWrappersnl_jacobi_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, double __pyx_v_w, double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
4451  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
4452  __Pyx_RefNannyDeclarations
4453  PyObject *__pyx_t_1 = NULL;
4454  int __pyx_t_2;
4455  Py_ssize_t __pyx_t_3;
4456  Py_ssize_t __pyx_t_4;
4457  Py_ssize_t __pyx_t_5;
4458  __Pyx_RefNannySetupContext("smootherWrappersnl_jacobi_NR_solve", 0);
4459 
4460  /* "csmoothers.pyx":157
4461  * DDATA dX):
4462  * cdef SuperMatrix AS
4463  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
4464  * AS.Dtype = superluWrappers._SLU_D
4465  * AS.Mtype = superluWrappers._SLU_GE
4466  */
4467  __pyx_v_AS.Stype = SLU_NR;
4468 
4469  /* "csmoothers.pyx":158
4470  * cdef SuperMatrix AS
4471  * AS.Stype = superluWrappers._SLU_NR
4472  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
4473  * AS.Mtype = superluWrappers._SLU_GE
4474  * AS.nrow = sm.nr
4475  */
4476  __pyx_v_AS.Dtype = SLU_D;
4477 
4478  /* "csmoothers.pyx":159
4479  * AS.Stype = superluWrappers._SLU_NR
4480  * AS.Dtype = superluWrappers._SLU_D
4481  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
4482  * AS.nrow = sm.nr
4483  * AS.ncol = sm.nc
4484  */
4485  __pyx_v_AS.Mtype = SLU_GE;
4486 
4487  /* "csmoothers.pyx":160
4488  * AS.Dtype = superluWrappers._SLU_D
4489  * AS.Mtype = superluWrappers._SLU_GE
4490  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
4491  * AS.ncol = sm.nc
4492  * AS.Store = &sm.A
4493  */
4494  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error)
4495  __Pyx_GOTREF(__pyx_t_1);
4496  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 160, __pyx_L1_error)
4497  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4498  __pyx_v_AS.nrow = __pyx_t_2;
4499 
4500  /* "csmoothers.pyx":161
4501  * AS.Mtype = superluWrappers._SLU_GE
4502  * AS.nrow = sm.nr
4503  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
4504  * AS.Store = &sm.A
4505  * cnl_jacobi_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
4506  */
4507  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error)
4508  __Pyx_GOTREF(__pyx_t_1);
4509  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 161, __pyx_L1_error)
4510  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4511  __pyx_v_AS.ncol = __pyx_t_2;
4512 
4513  /* "csmoothers.pyx":162
4514  * AS.nrow = sm.nr
4515  * AS.ncol = sm.nc
4516  * AS.Store = &sm.A # <<<<<<<<<<<<<<
4517  * cnl_jacobi_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
4518  *
4519  */
4520  __pyx_v_AS.Store = (&__pyx_v_sm->A);
4521 
4522  /* "csmoothers.pyx":163
4523  * AS.ncol = sm.nc
4524  * AS.Store = &sm.A
4525  * cnl_jacobi_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0]) # <<<<<<<<<<<<<<
4526  *
4527  * def gauss_seidel_NR_preare(A, w, tol, M):
4528  */
4529  __pyx_t_3 = 0;
4530  __pyx_t_2 = -1;
4531  if (__pyx_t_3 < 0) {
4532  __pyx_t_3 += __pyx_v_R.shape[0];
4533  if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
4534  } else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
4535  if (unlikely(__pyx_t_2 != -1)) {
4536  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4537  __PYX_ERR(0, 163, __pyx_L1_error)
4538  }
4539  __pyx_t_4 = 0;
4540  __pyx_t_2 = -1;
4541  if (__pyx_t_4 < 0) {
4542  __pyx_t_4 += __pyx_v_node_order.shape[0];
4543  if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
4544  } else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
4545  if (unlikely(__pyx_t_2 != -1)) {
4546  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4547  __PYX_ERR(0, 163, __pyx_L1_error)
4548  }
4549  __pyx_t_5 = 0;
4550  __pyx_t_2 = -1;
4551  if (__pyx_t_5 < 0) {
4552  __pyx_t_5 += __pyx_v_dX.shape[0];
4553  if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
4554  } else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
4555  if (unlikely(__pyx_t_2 != -1)) {
4556  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4557  __PYX_ERR(0, 163, __pyx_L1_error)
4558  }
4559  nl_jacobi_NR_solve((&__pyx_v_AS), (&(*((double *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_w, __pyx_v_tol, (&(*((double *) ( /* dim=0 */ (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))));
4560 
4561  /* "csmoothers.pyx":150
4562  * smootherWrappersnl_jacobi_NR_solve(A._cSparseMatrix, R, node_order, w, tol, dX)
4563  *
4564  * cdef void smootherWrappersnl_jacobi_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
4565  * DDATA R,
4566  * IDATA node_order,
4567  */
4568 
4569  /* function exit code */
4570  goto __pyx_L0;
4571  __pyx_L1_error:;
4572  __Pyx_XDECREF(__pyx_t_1);
4573  __Pyx_WriteUnraisable("csmoothers.smootherWrappersnl_jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4574  __pyx_L0:;
4575  __Pyx_RefNannyFinishContext();
4576 }
4577 
4578 /* "csmoothers.pyx":165
4579  * cnl_jacobi_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
4580  *
4581  * def gauss_seidel_NR_preare(A, w, tol, M): # <<<<<<<<<<<<<<
4582  * """
4583  *
4584  */
4585 
4586 /* Python wrapper */
4587 static PyObject *__pyx_pw_10csmoothers_7gauss_seidel_NR_preare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4588 static char __pyx_doc_10csmoothers_6gauss_seidel_NR_preare[] = "\n\n Arguments\n ---------\n A :\n w :\n tol :\n M :\n ";
4589 static PyMethodDef __pyx_mdef_10csmoothers_7gauss_seidel_NR_preare = {"gauss_seidel_NR_preare", (PyCFunction)__pyx_pw_10csmoothers_7gauss_seidel_NR_preare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_6gauss_seidel_NR_preare};
4590 static PyObject *__pyx_pw_10csmoothers_7gauss_seidel_NR_preare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4591  PyObject *__pyx_v_A = 0;
4592  PyObject *__pyx_v_w = 0;
4593  PyObject *__pyx_v_tol = 0;
4594  PyObject *__pyx_v_M = 0;
4595  PyObject *__pyx_r = 0;
4596  __Pyx_RefNannyDeclarations
4597  __Pyx_RefNannySetupContext("gauss_seidel_NR_preare (wrapper)", 0);
4598  {
4599  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_w,&__pyx_n_s_tol,&__pyx_n_s_M,0};
4600  PyObject* values[4] = {0,0,0,0};
4601  if (unlikely(__pyx_kwds)) {
4602  Py_ssize_t kw_args;
4603  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4604  switch (pos_args) {
4605  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4606  CYTHON_FALLTHROUGH;
4607  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4608  CYTHON_FALLTHROUGH;
4609  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4610  CYTHON_FALLTHROUGH;
4611  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4612  CYTHON_FALLTHROUGH;
4613  case 0: break;
4614  default: goto __pyx_L5_argtuple_error;
4615  }
4616  kw_args = PyDict_Size(__pyx_kwds);
4617  switch (pos_args) {
4618  case 0:
4619  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
4620  else goto __pyx_L5_argtuple_error;
4621  CYTHON_FALLTHROUGH;
4622  case 1:
4623  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
4624  else {
4625  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_preare", 1, 4, 4, 1); __PYX_ERR(0, 165, __pyx_L3_error)
4626  }
4627  CYTHON_FALLTHROUGH;
4628  case 2:
4629  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
4630  else {
4631  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_preare", 1, 4, 4, 2); __PYX_ERR(0, 165, __pyx_L3_error)
4632  }
4633  CYTHON_FALLTHROUGH;
4634  case 3:
4635  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_M)) != 0)) kw_args--;
4636  else {
4637  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_preare", 1, 4, 4, 3); __PYX_ERR(0, 165, __pyx_L3_error)
4638  }
4639  }
4640  if (unlikely(kw_args > 0)) {
4641  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gauss_seidel_NR_preare") < 0)) __PYX_ERR(0, 165, __pyx_L3_error)
4642  }
4643  } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
4644  goto __pyx_L5_argtuple_error;
4645  } else {
4646  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4647  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4648  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4649  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4650  }
4651  __pyx_v_A = values[0];
4652  __pyx_v_w = values[1];
4653  __pyx_v_tol = values[2];
4654  __pyx_v_M = values[3];
4655  }
4656  goto __pyx_L4_argument_unpacking_done;
4657  __pyx_L5_argtuple_error:;
4658  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_preare", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 165, __pyx_L3_error)
4659  __pyx_L3_error:;
4660  __Pyx_AddTraceback("csmoothers.gauss_seidel_NR_preare", __pyx_clineno, __pyx_lineno, __pyx_filename);
4661  __Pyx_RefNannyFinishContext();
4662  return NULL;
4663  __pyx_L4_argument_unpacking_done:;
4664  __pyx_r = __pyx_pf_10csmoothers_6gauss_seidel_NR_preare(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_tol, __pyx_v_M);
4665 
4666  /* function exit code */
4667  __Pyx_RefNannyFinishContext();
4668  return __pyx_r;
4669 }
4670 
4671 static PyObject *__pyx_pf_10csmoothers_6gauss_seidel_NR_preare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M) {
4672  PyObject *__pyx_r = NULL;
4673  __Pyx_RefNannyDeclarations
4674  PyObject *__pyx_t_1 = NULL;
4675  double __pyx_t_2;
4676  double __pyx_t_3;
4677  __pyx_t_10csmoothers_DDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
4678  __Pyx_RefNannySetupContext("gauss_seidel_NR_preare", 0);
4679 
4680  /* "csmoothers.pyx":175
4681  * M :
4682  * """
4683  * smootherWrappersgauss_seidel_NR_prepare(A._cSparseMatrix, w, tol, M) # <<<<<<<<<<<<<<
4684  *
4685  * cdef void smootherWrappersgauss_seidel_NR_prepare(superluWrappers.cSparseMatrix sm,
4686  */
4687  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error)
4688  __Pyx_GOTREF(__pyx_t_1);
4689  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 175, __pyx_L1_error)
4690  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_w); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L1_error)
4691  __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_tol); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L1_error)
4692  __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 175, __pyx_L1_error)
4693  __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_prepare(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4);
4694  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4695  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4696  __pyx_t_4.memview = NULL;
4697  __pyx_t_4.data = NULL;
4698 
4699  /* "csmoothers.pyx":165
4700  * cnl_jacobi_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
4701  *
4702  * def gauss_seidel_NR_preare(A, w, tol, M): # <<<<<<<<<<<<<<
4703  * """
4704  *
4705  */
4706 
4707  /* function exit code */
4708  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4709  goto __pyx_L0;
4710  __pyx_L1_error:;
4711  __Pyx_XDECREF(__pyx_t_1);
4712  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4713  __Pyx_AddTraceback("csmoothers.gauss_seidel_NR_preare", __pyx_clineno, __pyx_lineno, __pyx_filename);
4714  __pyx_r = NULL;
4715  __pyx_L0:;
4716  __Pyx_XGIVEREF(__pyx_r);
4717  __Pyx_RefNannyFinishContext();
4718  return __pyx_r;
4719 }
4720 
4721 /* "csmoothers.pyx":177
4722  * smootherWrappersgauss_seidel_NR_prepare(A._cSparseMatrix, w, tol, M)
4723  *
4724  * cdef void smootherWrappersgauss_seidel_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
4725  * double w,
4726  * double tol,
4727  */
4728 
4729 static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, double __pyx_v_w, double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_M) {
4730  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
4731  __Pyx_RefNannyDeclarations
4732  PyObject *__pyx_t_1 = NULL;
4733  int __pyx_t_2;
4734  Py_ssize_t __pyx_t_3;
4735  __Pyx_RefNannySetupContext("smootherWrappersgauss_seidel_NR_prepare", 0);
4736 
4737  /* "csmoothers.pyx":182
4738  * DDATA M):
4739  * cdef SuperMatrix AS
4740  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
4741  * AS.Dtype = superluWrappers._SLU_D
4742  * AS.Mtype = superluWrappers._SLU_GE
4743  */
4744  __pyx_v_AS.Stype = SLU_NR;
4745 
4746  /* "csmoothers.pyx":183
4747  * cdef SuperMatrix AS
4748  * AS.Stype = superluWrappers._SLU_NR
4749  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
4750  * AS.Mtype = superluWrappers._SLU_GE
4751  * AS.nrow = sm.nr
4752  */
4753  __pyx_v_AS.Dtype = SLU_D;
4754 
4755  /* "csmoothers.pyx":184
4756  * AS.Stype = superluWrappers._SLU_NR
4757  * AS.Dtype = superluWrappers._SLU_D
4758  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
4759  * AS.nrow = sm.nr
4760  * AS.ncol = sm.nc
4761  */
4762  __pyx_v_AS.Mtype = SLU_GE;
4763 
4764  /* "csmoothers.pyx":185
4765  * AS.Dtype = superluWrappers._SLU_D
4766  * AS.Mtype = superluWrappers._SLU_GE
4767  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
4768  * AS.ncol = sm.nc
4769  * AS.Store = &sm.A
4770  */
4771  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error)
4772  __Pyx_GOTREF(__pyx_t_1);
4773  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 185, __pyx_L1_error)
4774  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4775  __pyx_v_AS.nrow = __pyx_t_2;
4776 
4777  /* "csmoothers.pyx":186
4778  * AS.Mtype = superluWrappers._SLU_GE
4779  * AS.nrow = sm.nr
4780  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
4781  * AS.Store = &sm.A
4782  * cgauss_seidel_NR_prepare(&AS, w, tol, &M[0])
4783  */
4784  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error)
4785  __Pyx_GOTREF(__pyx_t_1);
4786  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L1_error)
4787  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4788  __pyx_v_AS.ncol = __pyx_t_2;
4789 
4790  /* "csmoothers.pyx":187
4791  * AS.nrow = sm.nr
4792  * AS.ncol = sm.nc
4793  * AS.Store = &sm.A # <<<<<<<<<<<<<<
4794  * cgauss_seidel_NR_prepare(&AS, w, tol, &M[0])
4795  *
4796  */
4797  __pyx_v_AS.Store = (&__pyx_v_sm->A);
4798 
4799  /* "csmoothers.pyx":188
4800  * AS.ncol = sm.nc
4801  * AS.Store = &sm.A
4802  * cgauss_seidel_NR_prepare(&AS, w, tol, &M[0]) # <<<<<<<<<<<<<<
4803  *
4804  * def gauss_seidel_NR_solve(A, M, R, node_order, dX):
4805  */
4806  __pyx_t_3 = 0;
4807  __pyx_t_2 = -1;
4808  if (__pyx_t_3 < 0) {
4809  __pyx_t_3 += __pyx_v_M.shape[0];
4810  if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
4811  } else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
4812  if (unlikely(__pyx_t_2 != -1)) {
4813  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4814  __PYX_ERR(0, 188, __pyx_L1_error)
4815  }
4816  gauss_seidel_NR_prepare((&__pyx_v_AS), __pyx_v_w, __pyx_v_tol, (&(*((double *) ( /* dim=0 */ (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))));
4817 
4818  /* "csmoothers.pyx":177
4819  * smootherWrappersgauss_seidel_NR_prepare(A._cSparseMatrix, w, tol, M)
4820  *
4821  * cdef void smootherWrappersgauss_seidel_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
4822  * double w,
4823  * double tol,
4824  */
4825 
4826  /* function exit code */
4827  goto __pyx_L0;
4828  __pyx_L1_error:;
4829  __Pyx_XDECREF(__pyx_t_1);
4830  __Pyx_WriteUnraisable("csmoothers.smootherWrappersgauss_seidel_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4831  __pyx_L0:;
4832  __Pyx_RefNannyFinishContext();
4833 }
4834 
4835 /* "csmoothers.pyx":190
4836  * cgauss_seidel_NR_prepare(&AS, w, tol, &M[0])
4837  *
4838  * def gauss_seidel_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
4839  * """
4840  *
4841  */
4842 
4843 /* Python wrapper */
4844 static PyObject *__pyx_pw_10csmoothers_9gauss_seidel_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4845 static char __pyx_doc_10csmoothers_8gauss_seidel_NR_solve[] = "\n\n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n M : np.array double\n R : np.array double\n node_order : np.array int\n dX : np.array double\n ";
4846 static PyMethodDef __pyx_mdef_10csmoothers_9gauss_seidel_NR_solve = {"gauss_seidel_NR_solve", (PyCFunction)__pyx_pw_10csmoothers_9gauss_seidel_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_8gauss_seidel_NR_solve};
4847 static PyObject *__pyx_pw_10csmoothers_9gauss_seidel_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4848  PyObject *__pyx_v_A = 0;
4849  PyObject *__pyx_v_M = 0;
4850  PyObject *__pyx_v_R = 0;
4851  PyObject *__pyx_v_node_order = 0;
4852  PyObject *__pyx_v_dX = 0;
4853  PyObject *__pyx_r = 0;
4854  __Pyx_RefNannyDeclarations
4855  __Pyx_RefNannySetupContext("gauss_seidel_NR_solve (wrapper)", 0);
4856  {
4857  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_M,&__pyx_n_s_R,&__pyx_n_s_node_order,&__pyx_n_s_dX,0};
4858  PyObject* values[5] = {0,0,0,0,0};
4859  if (unlikely(__pyx_kwds)) {
4860  Py_ssize_t kw_args;
4861  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4862  switch (pos_args) {
4863  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4864  CYTHON_FALLTHROUGH;
4865  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4866  CYTHON_FALLTHROUGH;
4867  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4868  CYTHON_FALLTHROUGH;
4869  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4870  CYTHON_FALLTHROUGH;
4871  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4872  CYTHON_FALLTHROUGH;
4873  case 0: break;
4874  default: goto __pyx_L5_argtuple_error;
4875  }
4876  kw_args = PyDict_Size(__pyx_kwds);
4877  switch (pos_args) {
4878  case 0:
4879  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
4880  else goto __pyx_L5_argtuple_error;
4881  CYTHON_FALLTHROUGH;
4882  case 1:
4883  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_M)) != 0)) kw_args--;
4884  else {
4885  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_solve", 1, 5, 5, 1); __PYX_ERR(0, 190, __pyx_L3_error)
4886  }
4887  CYTHON_FALLTHROUGH;
4888  case 2:
4889  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
4890  else {
4891  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_solve", 1, 5, 5, 2); __PYX_ERR(0, 190, __pyx_L3_error)
4892  }
4893  CYTHON_FALLTHROUGH;
4894  case 3:
4895  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
4896  else {
4897  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_solve", 1, 5, 5, 3); __PYX_ERR(0, 190, __pyx_L3_error)
4898  }
4899  CYTHON_FALLTHROUGH;
4900  case 4:
4901  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
4902  else {
4903  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_solve", 1, 5, 5, 4); __PYX_ERR(0, 190, __pyx_L3_error)
4904  }
4905  }
4906  if (unlikely(kw_args > 0)) {
4907  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gauss_seidel_NR_solve") < 0)) __PYX_ERR(0, 190, __pyx_L3_error)
4908  }
4909  } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
4910  goto __pyx_L5_argtuple_error;
4911  } else {
4912  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4913  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4914  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4915  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4916  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4917  }
4918  __pyx_v_A = values[0];
4919  __pyx_v_M = values[1];
4920  __pyx_v_R = values[2];
4921  __pyx_v_node_order = values[3];
4922  __pyx_v_dX = values[4];
4923  }
4924  goto __pyx_L4_argument_unpacking_done;
4925  __pyx_L5_argtuple_error:;
4926  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_solve", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 190, __pyx_L3_error)
4927  __pyx_L3_error:;
4928  __Pyx_AddTraceback("csmoothers.gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4929  __Pyx_RefNannyFinishContext();
4930  return NULL;
4931  __pyx_L4_argument_unpacking_done:;
4932  __pyx_r = __pyx_pf_10csmoothers_8gauss_seidel_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_M, __pyx_v_R, __pyx_v_node_order, __pyx_v_dX);
4933 
4934  /* function exit code */
4935  __Pyx_RefNannyFinishContext();
4936  return __pyx_r;
4937 }
4938 
4939 static PyObject *__pyx_pf_10csmoothers_8gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX) {
4940  PyObject *__pyx_r = NULL;
4941  __Pyx_RefNannyDeclarations
4942  PyObject *__pyx_t_1 = NULL;
4943  __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
4944  __pyx_t_10csmoothers_DDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
4945  __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
4946  __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
4947  __Pyx_RefNannySetupContext("gauss_seidel_NR_solve", 0);
4948 
4949  /* "csmoothers.pyx":201
4950  * dX : np.array double
4951  * """
4952  * smootherWrappersgauss_seidel_NR_solve(A._cSparseMatrix, M, R, node_order, dX) # <<<<<<<<<<<<<<
4953  *
4954  * cdef void smootherWrappersgauss_seidel_NR_solve(superluWrappers.cSparseMatrix sm,
4955  */
4956  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error)
4957  __Pyx_GOTREF(__pyx_t_1);
4958  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 201, __pyx_L1_error)
4959  __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 201, __pyx_L1_error)
4960  __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 201, __pyx_L1_error)
4961  __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 201, __pyx_L1_error)
4962  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 201, __pyx_L1_error)
4963  __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_solve(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5);
4964  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4965  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4966  __pyx_t_2.memview = NULL;
4967  __pyx_t_2.data = NULL;
4968  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4969  __pyx_t_3.memview = NULL;
4970  __pyx_t_3.data = NULL;
4971  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4972  __pyx_t_4.memview = NULL;
4973  __pyx_t_4.data = NULL;
4974  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
4975  __pyx_t_5.memview = NULL;
4976  __pyx_t_5.data = NULL;
4977 
4978  /* "csmoothers.pyx":190
4979  * cgauss_seidel_NR_prepare(&AS, w, tol, &M[0])
4980  *
4981  * def gauss_seidel_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
4982  * """
4983  *
4984  */
4985 
4986  /* function exit code */
4987  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4988  goto __pyx_L0;
4989  __pyx_L1_error:;
4990  __Pyx_XDECREF(__pyx_t_1);
4991  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4992  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4993  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4994  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
4995  __Pyx_AddTraceback("csmoothers.gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4996  __pyx_r = NULL;
4997  __pyx_L0:;
4998  __Pyx_XGIVEREF(__pyx_r);
4999  __Pyx_RefNannyFinishContext();
5000  return __pyx_r;
5001 }
5002 
5003 /* "csmoothers.pyx":203
5004  * smootherWrappersgauss_seidel_NR_solve(A._cSparseMatrix, M, R, node_order, dX)
5005  *
5006  * cdef void smootherWrappersgauss_seidel_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
5007  * DDATA M,
5008  * DDATA R,
5009  */
5010 
5011 static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_M, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
5012  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
5013  __Pyx_RefNannyDeclarations
5014  PyObject *__pyx_t_1 = NULL;
5015  int __pyx_t_2;
5016  Py_ssize_t __pyx_t_3;
5017  Py_ssize_t __pyx_t_4;
5018  Py_ssize_t __pyx_t_5;
5019  Py_ssize_t __pyx_t_6;
5020  __Pyx_RefNannySetupContext("smootherWrappersgauss_seidel_NR_solve", 0);
5021 
5022  /* "csmoothers.pyx":209
5023  * DDATA dX):
5024  * cdef SuperMatrix AS
5025  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
5026  * AS.Dtype = superluWrappers._SLU_D
5027  * AS.Mtype = superluWrappers._SLU_GE
5028  */
5029  __pyx_v_AS.Stype = SLU_NR;
5030 
5031  /* "csmoothers.pyx":210
5032  * cdef SuperMatrix AS
5033  * AS.Stype = superluWrappers._SLU_NR
5034  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
5035  * AS.Mtype = superluWrappers._SLU_GE
5036  * AS.nrow = sm.nr
5037  */
5038  __pyx_v_AS.Dtype = SLU_D;
5039 
5040  /* "csmoothers.pyx":211
5041  * AS.Stype = superluWrappers._SLU_NR
5042  * AS.Dtype = superluWrappers._SLU_D
5043  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
5044  * AS.nrow = sm.nr
5045  * AS.ncol = sm.nc
5046  */
5047  __pyx_v_AS.Mtype = SLU_GE;
5048 
5049  /* "csmoothers.pyx":212
5050  * AS.Dtype = superluWrappers._SLU_D
5051  * AS.Mtype = superluWrappers._SLU_GE
5052  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
5053  * AS.ncol = sm.nc
5054  * AS.Store = &sm.A
5055  */
5056  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error)
5057  __Pyx_GOTREF(__pyx_t_1);
5058  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L1_error)
5059  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5060  __pyx_v_AS.nrow = __pyx_t_2;
5061 
5062  /* "csmoothers.pyx":213
5063  * AS.Mtype = superluWrappers._SLU_GE
5064  * AS.nrow = sm.nr
5065  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
5066  * AS.Store = &sm.A
5067  * cgauss_seidel_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
5068  */
5069  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error)
5070  __Pyx_GOTREF(__pyx_t_1);
5071  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 213, __pyx_L1_error)
5072  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5073  __pyx_v_AS.ncol = __pyx_t_2;
5074 
5075  /* "csmoothers.pyx":214
5076  * AS.nrow = sm.nr
5077  * AS.ncol = sm.nc
5078  * AS.Store = &sm.A # <<<<<<<<<<<<<<
5079  * cgauss_seidel_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
5080  *
5081  */
5082  __pyx_v_AS.Store = (&__pyx_v_sm->A);
5083 
5084  /* "csmoothers.pyx":215
5085  * AS.ncol = sm.nc
5086  * AS.Store = &sm.A
5087  * cgauss_seidel_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0]) # <<<<<<<<<<<<<<
5088  *
5089  * def nl_gauss_seidel_NR_solve(A, R, node_order, w, tol, dX):
5090  */
5091  __pyx_t_3 = 0;
5092  __pyx_t_2 = -1;
5093  if (__pyx_t_3 < 0) {
5094  __pyx_t_3 += __pyx_v_M.shape[0];
5095  if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
5096  } else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
5097  if (unlikely(__pyx_t_2 != -1)) {
5098  __Pyx_RaiseBufferIndexError(__pyx_t_2);
5099  __PYX_ERR(0, 215, __pyx_L1_error)
5100  }
5101  __pyx_t_4 = 0;
5102  __pyx_t_2 = -1;
5103  if (__pyx_t_4 < 0) {
5104  __pyx_t_4 += __pyx_v_R.shape[0];
5105  if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
5106  } else if (unlikely(__pyx_t_4 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
5107  if (unlikely(__pyx_t_2 != -1)) {
5108  __Pyx_RaiseBufferIndexError(__pyx_t_2);
5109  __PYX_ERR(0, 215, __pyx_L1_error)
5110  }
5111  __pyx_t_5 = 0;
5112  __pyx_t_2 = -1;
5113  if (__pyx_t_5 < 0) {
5114  __pyx_t_5 += __pyx_v_node_order.shape[0];
5115  if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
5116  } else if (unlikely(__pyx_t_5 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
5117  if (unlikely(__pyx_t_2 != -1)) {
5118  __Pyx_RaiseBufferIndexError(__pyx_t_2);
5119  __PYX_ERR(0, 215, __pyx_L1_error)
5120  }
5121  __pyx_t_6 = 0;
5122  __pyx_t_2 = -1;
5123  if (__pyx_t_6 < 0) {
5124  __pyx_t_6 += __pyx_v_dX.shape[0];
5125  if (unlikely(__pyx_t_6 < 0)) __pyx_t_2 = 0;
5126  } else if (unlikely(__pyx_t_6 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
5127  if (unlikely(__pyx_t_2 != -1)) {
5128  __Pyx_RaiseBufferIndexError(__pyx_t_2);
5129  __PYX_ERR(0, 215, __pyx_L1_error)
5130  }
5131  gauss_seidel_NR_solve((&__pyx_v_AS), (&(*((double *) ( /* dim=0 */ (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_4 * __pyx_v_R.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_node_order.data + __pyx_t_5 * __pyx_v_node_order.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_dX.data + __pyx_t_6 * __pyx_v_dX.strides[0]) )))));
5132 
5133  /* "csmoothers.pyx":203
5134  * smootherWrappersgauss_seidel_NR_solve(A._cSparseMatrix, M, R, node_order, dX)
5135  *
5136  * cdef void smootherWrappersgauss_seidel_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
5137  * DDATA M,
5138  * DDATA R,
5139  */
5140 
5141  /* function exit code */
5142  goto __pyx_L0;
5143  __pyx_L1_error:;
5144  __Pyx_XDECREF(__pyx_t_1);
5145  __Pyx_WriteUnraisable("csmoothers.smootherWrappersgauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
5146  __pyx_L0:;
5147  __Pyx_RefNannyFinishContext();
5148 }
5149 
5150 /* "csmoothers.pyx":217
5151  * cgauss_seidel_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
5152  *
5153  * def nl_gauss_seidel_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
5154  * """
5155  *
5156  */
5157 
5158 /* Python wrapper */
5159 static PyObject *__pyx_pw_10csmoothers_11nl_gauss_seidel_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5160 static char __pyx_doc_10csmoothers_10nl_gauss_seidel_NR_solve[] = "\n \n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n R : np.array double\n node_order : np.array int\n w : double\n tol : double\n dX : np.array double\n ";
5161 static PyMethodDef __pyx_mdef_10csmoothers_11nl_gauss_seidel_NR_solve = {"nl_gauss_seidel_NR_solve", (PyCFunction)__pyx_pw_10csmoothers_11nl_gauss_seidel_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_10nl_gauss_seidel_NR_solve};
5162 static PyObject *__pyx_pw_10csmoothers_11nl_gauss_seidel_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5163  PyObject *__pyx_v_A = 0;
5164  PyObject *__pyx_v_R = 0;
5165  PyObject *__pyx_v_node_order = 0;
5166  PyObject *__pyx_v_w = 0;
5167  PyObject *__pyx_v_tol = 0;
5168  PyObject *__pyx_v_dX = 0;
5169  PyObject *__pyx_r = 0;
5170  __Pyx_RefNannyDeclarations
5171  __Pyx_RefNannySetupContext("nl_gauss_seidel_NR_solve (wrapper)", 0);
5172  {
5173  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_R,&__pyx_n_s_node_order,&__pyx_n_s_w,&__pyx_n_s_tol,&__pyx_n_s_dX,0};
5174  PyObject* values[6] = {0,0,0,0,0,0};
5175  if (unlikely(__pyx_kwds)) {
5176  Py_ssize_t kw_args;
5177  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5178  switch (pos_args) {
5179  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5180  CYTHON_FALLTHROUGH;
5181  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5182  CYTHON_FALLTHROUGH;
5183  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5184  CYTHON_FALLTHROUGH;
5185  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5186  CYTHON_FALLTHROUGH;
5187  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5188  CYTHON_FALLTHROUGH;
5189  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5190  CYTHON_FALLTHROUGH;
5191  case 0: break;
5192  default: goto __pyx_L5_argtuple_error;
5193  }
5194  kw_args = PyDict_Size(__pyx_kwds);
5195  switch (pos_args) {
5196  case 0:
5197  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
5198  else goto __pyx_L5_argtuple_error;
5199  CYTHON_FALLTHROUGH;
5200  case 1:
5201  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
5202  else {
5203  __Pyx_RaiseArgtupleInvalid("nl_gauss_seidel_NR_solve", 1, 6, 6, 1); __PYX_ERR(0, 217, __pyx_L3_error)
5204  }
5205  CYTHON_FALLTHROUGH;
5206  case 2:
5207  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
5208  else {
5209  __Pyx_RaiseArgtupleInvalid("nl_gauss_seidel_NR_solve", 1, 6, 6, 2); __PYX_ERR(0, 217, __pyx_L3_error)
5210  }
5211  CYTHON_FALLTHROUGH;
5212  case 3:
5213  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
5214  else {
5215  __Pyx_RaiseArgtupleInvalid("nl_gauss_seidel_NR_solve", 1, 6, 6, 3); __PYX_ERR(0, 217, __pyx_L3_error)
5216  }
5217  CYTHON_FALLTHROUGH;
5218  case 4:
5219  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
5220  else {
5221  __Pyx_RaiseArgtupleInvalid("nl_gauss_seidel_NR_solve", 1, 6, 6, 4); __PYX_ERR(0, 217, __pyx_L3_error)
5222  }
5223  CYTHON_FALLTHROUGH;
5224  case 5:
5225  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
5226  else {
5227  __Pyx_RaiseArgtupleInvalid("nl_gauss_seidel_NR_solve", 1, 6, 6, 5); __PYX_ERR(0, 217, __pyx_L3_error)
5228  }
5229  }
5230  if (unlikely(kw_args > 0)) {
5231  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "nl_gauss_seidel_NR_solve") < 0)) __PYX_ERR(0, 217, __pyx_L3_error)
5232  }
5233  } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
5234  goto __pyx_L5_argtuple_error;
5235  } else {
5236  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5237  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5238  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5239  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5240  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5241  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5242  }
5243  __pyx_v_A = values[0];
5244  __pyx_v_R = values[1];
5245  __pyx_v_node_order = values[2];
5246  __pyx_v_w = values[3];
5247  __pyx_v_tol = values[4];
5248  __pyx_v_dX = values[5];
5249  }
5250  goto __pyx_L4_argument_unpacking_done;
5251  __pyx_L5_argtuple_error:;
5252  __Pyx_RaiseArgtupleInvalid("nl_gauss_seidel_NR_solve", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 217, __pyx_L3_error)
5253  __pyx_L3_error:;
5254  __Pyx_AddTraceback("csmoothers.nl_gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5255  __Pyx_RefNannyFinishContext();
5256  return NULL;
5257  __pyx_L4_argument_unpacking_done:;
5258  __pyx_r = __pyx_pf_10csmoothers_10nl_gauss_seidel_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_R, __pyx_v_node_order, __pyx_v_w, __pyx_v_tol, __pyx_v_dX);
5259 
5260  /* function exit code */
5261  __Pyx_RefNannyFinishContext();
5262  return __pyx_r;
5263 }
5264 
5265 static PyObject *__pyx_pf_10csmoothers_10nl_gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX) {
5266  PyObject *__pyx_r = NULL;
5267  __Pyx_RefNannyDeclarations
5268  PyObject *__pyx_t_1 = NULL;
5269  __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
5270  __pyx_t_10csmoothers_IDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
5271  double __pyx_t_4;
5272  double __pyx_t_5;
5273  __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
5274  PyObject *__pyx_t_7 = NULL;
5275  __Pyx_RefNannySetupContext("nl_gauss_seidel_NR_solve", 0);
5276 
5277  /* "csmoothers.pyx":229
5278  * dX : np.array double
5279  * """
5280  * smootherWrappers_nl_gauss_seidel_NR_solve(A._cSparseMatrix, # <<<<<<<<<<<<<<
5281  * R,
5282  * node_order,
5283  */
5284  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
5285  __Pyx_GOTREF(__pyx_t_1);
5286  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 229, __pyx_L1_error)
5287 
5288  /* "csmoothers.pyx":230
5289  * """
5290  * smootherWrappers_nl_gauss_seidel_NR_solve(A._cSparseMatrix,
5291  * R, # <<<<<<<<<<<<<<
5292  * node_order,
5293  * w,
5294  */
5295  __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 230, __pyx_L1_error)
5296 
5297  /* "csmoothers.pyx":231
5298  * smootherWrappers_nl_gauss_seidel_NR_solve(A._cSparseMatrix,
5299  * R,
5300  * node_order, # <<<<<<<<<<<<<<
5301  * w,
5302  * tol,
5303  */
5304  __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 231, __pyx_L1_error)
5305 
5306  /* "csmoothers.pyx":232
5307  * R,
5308  * node_order,
5309  * w, # <<<<<<<<<<<<<<
5310  * tol,
5311  * dX)
5312  */
5313  __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_w); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 232, __pyx_L1_error)
5314 
5315  /* "csmoothers.pyx":233
5316  * node_order,
5317  * w,
5318  * tol, # <<<<<<<<<<<<<<
5319  * dX)
5320  *
5321  */
5322  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_tol); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 233, __pyx_L1_error)
5323 
5324  /* "csmoothers.pyx":234
5325  * w,
5326  * tol,
5327  * dX) # <<<<<<<<<<<<<<
5328  *
5329  * cdef smootherWrappers_nl_gauss_seidel_NR_solve(superluWrappers.cSparseMatrix sm,
5330  */
5331  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 234, __pyx_L1_error)
5332 
5333  /* "csmoothers.pyx":229
5334  * dX : np.array double
5335  * """
5336  * smootherWrappers_nl_gauss_seidel_NR_solve(A._cSparseMatrix, # <<<<<<<<<<<<<<
5337  * R,
5338  * node_order,
5339  */
5340  __pyx_t_7 = __pyx_f_10csmoothers_smootherWrappers_nl_gauss_seidel_NR_solve(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 229, __pyx_L1_error)
5341  __Pyx_GOTREF(__pyx_t_7);
5342  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5343  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5344  __pyx_t_2.memview = NULL;
5345  __pyx_t_2.data = NULL;
5346  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
5347  __pyx_t_3.memview = NULL;
5348  __pyx_t_3.data = NULL;
5349  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5350  __pyx_t_6.memview = NULL;
5351  __pyx_t_6.data = NULL;
5352  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5353 
5354  /* "csmoothers.pyx":217
5355  * cgauss_seidel_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
5356  *
5357  * def nl_gauss_seidel_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
5358  * """
5359  *
5360  */
5361 
5362  /* function exit code */
5363  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5364  goto __pyx_L0;
5365  __pyx_L1_error:;
5366  __Pyx_XDECREF(__pyx_t_1);
5367  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5368  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
5369  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5370  __Pyx_XDECREF(__pyx_t_7);
5371  __Pyx_AddTraceback("csmoothers.nl_gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5372  __pyx_r = NULL;
5373  __pyx_L0:;
5374  __Pyx_XGIVEREF(__pyx_r);
5375  __Pyx_RefNannyFinishContext();
5376  return __pyx_r;
5377 }
5378 
5379 /* "csmoothers.pyx":236
5380  * dX)
5381  *
5382  * cdef smootherWrappers_nl_gauss_seidel_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
5383  * DDATA R,
5384  * IDATA node_order,
5385  */
5386 
5387 static PyObject *__pyx_f_10csmoothers_smootherWrappers_nl_gauss_seidel_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, double __pyx_v_w, double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
5388  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
5389  PyObject *__pyx_r = NULL;
5390  __Pyx_RefNannyDeclarations
5391  PyObject *__pyx_t_1 = NULL;
5392  int __pyx_t_2;
5393  Py_ssize_t __pyx_t_3;
5394  Py_ssize_t __pyx_t_4;
5395  Py_ssize_t __pyx_t_5;
5396  __Pyx_RefNannySetupContext("smootherWrappers_nl_gauss_seidel_NR_solve", 0);
5397 
5398  /* "csmoothers.pyx":243
5399  * DDATA dX):
5400  * cdef SuperMatrix AS
5401  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
5402  * AS.Dtype = superluWrappers._SLU_D
5403  * AS.Mtype = superluWrappers._SLU_GE
5404  */
5405  __pyx_v_AS.Stype = SLU_NR;
5406 
5407  /* "csmoothers.pyx":244
5408  * cdef SuperMatrix AS
5409  * AS.Stype = superluWrappers._SLU_NR
5410  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
5411  * AS.Mtype = superluWrappers._SLU_GE
5412  * AS.nrow = sm.nr
5413  */
5414  __pyx_v_AS.Dtype = SLU_D;
5415 
5416  /* "csmoothers.pyx":245
5417  * AS.Stype = superluWrappers._SLU_NR
5418  * AS.Dtype = superluWrappers._SLU_D
5419  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
5420  * AS.nrow = sm.nr
5421  * AS.ncol = sm.nc
5422  */
5423  __pyx_v_AS.Mtype = SLU_GE;
5424 
5425  /* "csmoothers.pyx":246
5426  * AS.Dtype = superluWrappers._SLU_D
5427  * AS.Mtype = superluWrappers._SLU_GE
5428  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
5429  * AS.ncol = sm.nc
5430  * AS.Store = &sm.A
5431  */
5432  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error)
5433  __Pyx_GOTREF(__pyx_t_1);
5434  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 246, __pyx_L1_error)
5435  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5436  __pyx_v_AS.nrow = __pyx_t_2;
5437 
5438  /* "csmoothers.pyx":247
5439  * AS.Mtype = superluWrappers._SLU_GE
5440  * AS.nrow = sm.nr
5441  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
5442  * AS.Store = &sm.A
5443  * cnl_gauss_seidel_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
5444  */
5445  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error)
5446  __Pyx_GOTREF(__pyx_t_1);
5447  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 247, __pyx_L1_error)
5448  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5449  __pyx_v_AS.ncol = __pyx_t_2;
5450 
5451  /* "csmoothers.pyx":248
5452  * AS.nrow = sm.nr
5453  * AS.ncol = sm.nc
5454  * AS.Store = &sm.A # <<<<<<<<<<<<<<
5455  * cnl_gauss_seidel_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
5456  *
5457  */
5458  __pyx_v_AS.Store = (&__pyx_v_sm->A);
5459 
5460  /* "csmoothers.pyx":249
5461  * AS.ncol = sm.nc
5462  * AS.Store = &sm.A
5463  * cnl_gauss_seidel_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0]) # <<<<<<<<<<<<<<
5464  *
5465  * def asm_NR_prepare(A, asmFactor):
5466  */
5467  __pyx_t_3 = 0;
5468  __pyx_t_2 = -1;
5469  if (__pyx_t_3 < 0) {
5470  __pyx_t_3 += __pyx_v_R.shape[0];
5471  if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
5472  } else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
5473  if (unlikely(__pyx_t_2 != -1)) {
5474  __Pyx_RaiseBufferIndexError(__pyx_t_2);
5475  __PYX_ERR(0, 249, __pyx_L1_error)
5476  }
5477  __pyx_t_4 = 0;
5478  __pyx_t_2 = -1;
5479  if (__pyx_t_4 < 0) {
5480  __pyx_t_4 += __pyx_v_node_order.shape[0];
5481  if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
5482  } else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
5483  if (unlikely(__pyx_t_2 != -1)) {
5484  __Pyx_RaiseBufferIndexError(__pyx_t_2);
5485  __PYX_ERR(0, 249, __pyx_L1_error)
5486  }
5487  __pyx_t_5 = 0;
5488  __pyx_t_2 = -1;
5489  if (__pyx_t_5 < 0) {
5490  __pyx_t_5 += __pyx_v_dX.shape[0];
5491  if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
5492  } else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
5493  if (unlikely(__pyx_t_2 != -1)) {
5494  __Pyx_RaiseBufferIndexError(__pyx_t_2);
5495  __PYX_ERR(0, 249, __pyx_L1_error)
5496  }
5497  nl_gauss_seidel_NR_solve((&__pyx_v_AS), (&(*((double *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_w, __pyx_v_tol, (&(*((double *) ( /* dim=0 */ (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))));
5498 
5499  /* "csmoothers.pyx":236
5500  * dX)
5501  *
5502  * cdef smootherWrappers_nl_gauss_seidel_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
5503  * DDATA R,
5504  * IDATA node_order,
5505  */
5506 
5507  /* function exit code */
5508  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5509  goto __pyx_L0;
5510  __pyx_L1_error:;
5511  __Pyx_XDECREF(__pyx_t_1);
5512  __Pyx_AddTraceback("csmoothers.smootherWrappers_nl_gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5513  __pyx_r = 0;
5514  __pyx_L0:;
5515  __Pyx_XGIVEREF(__pyx_r);
5516  __Pyx_RefNannyFinishContext();
5517  return __pyx_r;
5518 }
5519 
5520 /* "csmoothers.pyx":251
5521  * cnl_gauss_seidel_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
5522  *
5523  * def asm_NR_prepare(A, asmFactor): # <<<<<<<<<<<<<<
5524  * """
5525  *
5526  */
5527 
5528 /* Python wrapper */
5529 static PyObject *__pyx_pw_10csmoothers_13asm_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5530 static char __pyx_doc_10csmoothers_12asm_NR_prepare[] = "\n\n Arguments\n ---------\n A :\n asmFactor :\n ";
5531 static PyMethodDef __pyx_mdef_10csmoothers_13asm_NR_prepare = {"asm_NR_prepare", (PyCFunction)__pyx_pw_10csmoothers_13asm_NR_prepare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_12asm_NR_prepare};
5532 static PyObject *__pyx_pw_10csmoothers_13asm_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5533  PyObject *__pyx_v_A = 0;
5534  PyObject *__pyx_v_asmFactor = 0;
5535  PyObject *__pyx_r = 0;
5536  __Pyx_RefNannyDeclarations
5537  __Pyx_RefNannySetupContext("asm_NR_prepare (wrapper)", 0);
5538  {
5539  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_asmFactor,0};
5540  PyObject* values[2] = {0,0};
5541  if (unlikely(__pyx_kwds)) {
5542  Py_ssize_t kw_args;
5543  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5544  switch (pos_args) {
5545  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5546  CYTHON_FALLTHROUGH;
5547  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5548  CYTHON_FALLTHROUGH;
5549  case 0: break;
5550  default: goto __pyx_L5_argtuple_error;
5551  }
5552  kw_args = PyDict_Size(__pyx_kwds);
5553  switch (pos_args) {
5554  case 0:
5555  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
5556  else goto __pyx_L5_argtuple_error;
5557  CYTHON_FALLTHROUGH;
5558  case 1:
5559  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_asmFactor)) != 0)) kw_args--;
5560  else {
5561  __Pyx_RaiseArgtupleInvalid("asm_NR_prepare", 1, 2, 2, 1); __PYX_ERR(0, 251, __pyx_L3_error)
5562  }
5563  }
5564  if (unlikely(kw_args > 0)) {
5565  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "asm_NR_prepare") < 0)) __PYX_ERR(0, 251, __pyx_L3_error)
5566  }
5567  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5568  goto __pyx_L5_argtuple_error;
5569  } else {
5570  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5571  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5572  }
5573  __pyx_v_A = values[0];
5574  __pyx_v_asmFactor = values[1];
5575  }
5576  goto __pyx_L4_argument_unpacking_done;
5577  __pyx_L5_argtuple_error:;
5578  __Pyx_RaiseArgtupleInvalid("asm_NR_prepare", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 251, __pyx_L3_error)
5579  __pyx_L3_error:;
5580  __Pyx_AddTraceback("csmoothers.asm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5581  __Pyx_RefNannyFinishContext();
5582  return NULL;
5583  __pyx_L4_argument_unpacking_done:;
5584  __pyx_r = __pyx_pf_10csmoothers_12asm_NR_prepare(__pyx_self, __pyx_v_A, __pyx_v_asmFactor);
5585 
5586  /* function exit code */
5587  __Pyx_RefNannyFinishContext();
5588  return __pyx_r;
5589 }
5590 
5591 static PyObject *__pyx_pf_10csmoothers_12asm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_asmFactor) {
5592  PyObject *__pyx_r = NULL;
5593  __Pyx_RefNannyDeclarations
5594  PyObject *__pyx_t_1 = NULL;
5595  PyObject *__pyx_t_2 = NULL;
5596  __Pyx_RefNannySetupContext("asm_NR_prepare", 0);
5597 
5598  /* "csmoothers.pyx":259
5599  * asmFactor :
5600  * """
5601  * smootherWrappers_asm_NR_prepare(A._cSparseMatrix, # <<<<<<<<<<<<<<
5602  * asmFactor._cASMFactor)
5603  *
5604  */
5605  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error)
5606  __Pyx_GOTREF(__pyx_t_1);
5607  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 259, __pyx_L1_error)
5608 
5609  /* "csmoothers.pyx":260
5610  * """
5611  * smootherWrappers_asm_NR_prepare(A._cSparseMatrix,
5612  * asmFactor._cASMFactor) # <<<<<<<<<<<<<<
5613  *
5614  * cdef void smootherWrappers_asm_NR_prepare(superluWrappers.cSparseMatrix sm,
5615  */
5616  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_asmFactor, __pyx_n_s_cASMFactor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error)
5617  __Pyx_GOTREF(__pyx_t_2);
5618  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10csmoothers_cASMFactor))))) __PYX_ERR(0, 260, __pyx_L1_error)
5619 
5620  /* "csmoothers.pyx":259
5621  * asmFactor :
5622  * """
5623  * smootherWrappers_asm_NR_prepare(A._cSparseMatrix, # <<<<<<<<<<<<<<
5624  * asmFactor._cASMFactor)
5625  *
5626  */
5627  __pyx_f_10csmoothers_smootherWrappers_asm_NR_prepare(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), ((struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_t_2));
5628  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5629  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5630 
5631  /* "csmoothers.pyx":251
5632  * cnl_gauss_seidel_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
5633  *
5634  * def asm_NR_prepare(A, asmFactor): # <<<<<<<<<<<<<<
5635  * """
5636  *
5637  */
5638 
5639  /* function exit code */
5640  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5641  goto __pyx_L0;
5642  __pyx_L1_error:;
5643  __Pyx_XDECREF(__pyx_t_1);
5644  __Pyx_XDECREF(__pyx_t_2);
5645  __Pyx_AddTraceback("csmoothers.asm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5646  __pyx_r = NULL;
5647  __pyx_L0:;
5648  __Pyx_XGIVEREF(__pyx_r);
5649  __Pyx_RefNannyFinishContext();
5650  return __pyx_r;
5651 }
5652 
5653 /* "csmoothers.pyx":262
5654  * asmFactor._cASMFactor)
5655  *
5656  * cdef void smootherWrappers_asm_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
5657  * cASMFactor asmFactor):
5658  * cdef SuperMatrix AS
5659  */
5660 
5661 static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_asmFactor) {
5662  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
5663  __Pyx_RefNannyDeclarations
5664  PyObject *__pyx_t_1 = NULL;
5665  int __pyx_t_2;
5666  __Pyx_RefNannySetupContext("smootherWrappers_asm_NR_prepare", 0);
5667 
5668  /* "csmoothers.pyx":265
5669  * cASMFactor asmFactor):
5670  * cdef SuperMatrix AS
5671  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
5672  * AS.Dtype = superluWrappers._SLU_D
5673  * AS.Mtype = superluWrappers._SLU_GE
5674  */
5675  __pyx_v_AS.Stype = SLU_NR;
5676 
5677  /* "csmoothers.pyx":266
5678  * cdef SuperMatrix AS
5679  * AS.Stype = superluWrappers._SLU_NR
5680  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
5681  * AS.Mtype = superluWrappers._SLU_GE
5682  * AS.nrow = sm.nr
5683  */
5684  __pyx_v_AS.Dtype = SLU_D;
5685 
5686  /* "csmoothers.pyx":267
5687  * AS.Stype = superluWrappers._SLU_NR
5688  * AS.Dtype = superluWrappers._SLU_D
5689  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
5690  * AS.nrow = sm.nr
5691  * AS.ncol = sm.nc
5692  */
5693  __pyx_v_AS.Mtype = SLU_GE;
5694 
5695  /* "csmoothers.pyx":268
5696  * AS.Dtype = superluWrappers._SLU_D
5697  * AS.Mtype = superluWrappers._SLU_GE
5698  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
5699  * AS.ncol = sm.nc
5700  * AS.Store = &sm.A
5701  */
5702  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error)
5703  __Pyx_GOTREF(__pyx_t_1);
5704  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 268, __pyx_L1_error)
5705  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5706  __pyx_v_AS.nrow = __pyx_t_2;
5707 
5708  /* "csmoothers.pyx":269
5709  * AS.Mtype = superluWrappers._SLU_GE
5710  * AS.nrow = sm.nr
5711  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
5712  * AS.Store = &sm.A
5713  * casm_NR_prepare(&AS,
5714  */
5715  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error)
5716  __Pyx_GOTREF(__pyx_t_1);
5717  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 269, __pyx_L1_error)
5718  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5719  __pyx_v_AS.ncol = __pyx_t_2;
5720 
5721  /* "csmoothers.pyx":270
5722  * AS.nrow = sm.nr
5723  * AS.ncol = sm.nc
5724  * AS.Store = &sm.A # <<<<<<<<<<<<<<
5725  * casm_NR_prepare(&AS,
5726  * asmFactor.subdomain_dim,
5727  */
5728  __pyx_v_AS.Store = (&__pyx_v_sm->A);
5729 
5730  /* "csmoothers.pyx":271
5731  * AS.ncol = sm.nc
5732  * AS.Store = &sm.A
5733  * casm_NR_prepare(&AS, # <<<<<<<<<<<<<<
5734  * asmFactor.subdomain_dim,
5735  * asmFactor.l2g_L,
5736  */
5737  asm_NR_prepare((&__pyx_v_AS), __pyx_v_asmFactor->subdomain_dim, __pyx_v_asmFactor->l2g_L, __pyx_v_asmFactor->subdomain_L, __pyx_v_asmFactor->subdomain_pivots);
5738 
5739  /* "csmoothers.pyx":262
5740  * asmFactor._cASMFactor)
5741  *
5742  * cdef void smootherWrappers_asm_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
5743  * cASMFactor asmFactor):
5744  * cdef SuperMatrix AS
5745  */
5746 
5747  /* function exit code */
5748  goto __pyx_L0;
5749  __pyx_L1_error:;
5750  __Pyx_XDECREF(__pyx_t_1);
5751  __Pyx_WriteUnraisable("csmoothers.smootherWrappers_asm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
5752  __pyx_L0:;
5753  __Pyx_RefNannyFinishContext();
5754 }
5755 
5756 /* "csmoothers.pyx":277
5757  * asmFactor.subdomain_pivots)
5758  *
5759  * def asm_NR_solve(A, w, asmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
5760  * """
5761  *
5762  */
5763 
5764 /* Python wrapper */
5765 static PyObject *__pyx_pw_10csmoothers_15asm_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5766 static char __pyx_doc_10csmoothers_14asm_NR_solve[] = "\n \n Arguments\n ---------\n A : superluWrappers.sparseMatrix\n w : double\n asmFactor : csmoothers.asmFactor\n node_order : np.array int\n R : np.array double\n dX : np.array double\n ";
5767 static PyMethodDef __pyx_mdef_10csmoothers_15asm_NR_solve = {"asm_NR_solve", (PyCFunction)__pyx_pw_10csmoothers_15asm_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_14asm_NR_solve};
5768 static PyObject *__pyx_pw_10csmoothers_15asm_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5769  PyObject *__pyx_v_A = 0;
5770  PyObject *__pyx_v_w = 0;
5771  PyObject *__pyx_v_asmFactor = 0;
5772  PyObject *__pyx_v_node_order = 0;
5773  PyObject *__pyx_v_R = 0;
5774  PyObject *__pyx_v_dX = 0;
5775  PyObject *__pyx_r = 0;
5776  __Pyx_RefNannyDeclarations
5777  __Pyx_RefNannySetupContext("asm_NR_solve (wrapper)", 0);
5778  {
5779  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_w,&__pyx_n_s_asmFactor,&__pyx_n_s_node_order,&__pyx_n_s_R,&__pyx_n_s_dX,0};
5780  PyObject* values[6] = {0,0,0,0,0,0};
5781  if (unlikely(__pyx_kwds)) {
5782  Py_ssize_t kw_args;
5783  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5784  switch (pos_args) {
5785  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5786  CYTHON_FALLTHROUGH;
5787  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5788  CYTHON_FALLTHROUGH;
5789  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5790  CYTHON_FALLTHROUGH;
5791  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5792  CYTHON_FALLTHROUGH;
5793  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5794  CYTHON_FALLTHROUGH;
5795  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5796  CYTHON_FALLTHROUGH;
5797  case 0: break;
5798  default: goto __pyx_L5_argtuple_error;
5799  }
5800  kw_args = PyDict_Size(__pyx_kwds);
5801  switch (pos_args) {
5802  case 0:
5803  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
5804  else goto __pyx_L5_argtuple_error;
5805  CYTHON_FALLTHROUGH;
5806  case 1:
5807  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
5808  else {
5809  __Pyx_RaiseArgtupleInvalid("asm_NR_solve", 1, 6, 6, 1); __PYX_ERR(0, 277, __pyx_L3_error)
5810  }
5811  CYTHON_FALLTHROUGH;
5812  case 2:
5813  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_asmFactor)) != 0)) kw_args--;
5814  else {
5815  __Pyx_RaiseArgtupleInvalid("asm_NR_solve", 1, 6, 6, 2); __PYX_ERR(0, 277, __pyx_L3_error)
5816  }
5817  CYTHON_FALLTHROUGH;
5818  case 3:
5819  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
5820  else {
5821  __Pyx_RaiseArgtupleInvalid("asm_NR_solve", 1, 6, 6, 3); __PYX_ERR(0, 277, __pyx_L3_error)
5822  }
5823  CYTHON_FALLTHROUGH;
5824  case 4:
5825  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
5826  else {
5827  __Pyx_RaiseArgtupleInvalid("asm_NR_solve", 1, 6, 6, 4); __PYX_ERR(0, 277, __pyx_L3_error)
5828  }
5829  CYTHON_FALLTHROUGH;
5830  case 5:
5831  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
5832  else {
5833  __Pyx_RaiseArgtupleInvalid("asm_NR_solve", 1, 6, 6, 5); __PYX_ERR(0, 277, __pyx_L3_error)
5834  }
5835  }
5836  if (unlikely(kw_args > 0)) {
5837  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "asm_NR_solve") < 0)) __PYX_ERR(0, 277, __pyx_L3_error)
5838  }
5839  } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
5840  goto __pyx_L5_argtuple_error;
5841  } else {
5842  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5843  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5844  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5845  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5846  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5847  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5848  }
5849  __pyx_v_A = values[0];
5850  __pyx_v_w = values[1];
5851  __pyx_v_asmFactor = values[2];
5852  __pyx_v_node_order = values[3];
5853  __pyx_v_R = values[4];
5854  __pyx_v_dX = values[5];
5855  }
5856  goto __pyx_L4_argument_unpacking_done;
5857  __pyx_L5_argtuple_error:;
5858  __Pyx_RaiseArgtupleInvalid("asm_NR_solve", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 277, __pyx_L3_error)
5859  __pyx_L3_error:;
5860  __Pyx_AddTraceback("csmoothers.asm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5861  __Pyx_RefNannyFinishContext();
5862  return NULL;
5863  __pyx_L4_argument_unpacking_done:;
5864  __pyx_r = __pyx_pf_10csmoothers_14asm_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_asmFactor, __pyx_v_node_order, __pyx_v_R, __pyx_v_dX);
5865 
5866  /* function exit code */
5867  __Pyx_RefNannyFinishContext();
5868  return __pyx_r;
5869 }
5870 
5871 static PyObject *__pyx_pf_10csmoothers_14asm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_asmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX) {
5872  PyObject *__pyx_r = NULL;
5873  __Pyx_RefNannyDeclarations
5874  PyObject *__pyx_t_1 = NULL;
5875  double __pyx_t_2;
5876  PyObject *__pyx_t_3 = NULL;
5877  __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
5878  __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
5879  __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
5880  __Pyx_RefNannySetupContext("asm_NR_solve", 0);
5881 
5882  /* "csmoothers.pyx":289
5883  * dX : np.array double
5884  * """
5885  * smootherWrappers_asm_NR_solve(A._cSparseMatrix, # <<<<<<<<<<<<<<
5886  * w,
5887  * asmFactor._cASMFactor,
5888  */
5889  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 289, __pyx_L1_error)
5890  __Pyx_GOTREF(__pyx_t_1);
5891  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 289, __pyx_L1_error)
5892 
5893  /* "csmoothers.pyx":290
5894  * """
5895  * smootherWrappers_asm_NR_solve(A._cSparseMatrix,
5896  * w, # <<<<<<<<<<<<<<
5897  * asmFactor._cASMFactor,
5898  * node_order,
5899  */
5900  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_w); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 290, __pyx_L1_error)
5901 
5902  /* "csmoothers.pyx":291
5903  * smootherWrappers_asm_NR_solve(A._cSparseMatrix,
5904  * w,
5905  * asmFactor._cASMFactor, # <<<<<<<<<<<<<<
5906  * node_order,
5907  * R,
5908  */
5909  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_asmFactor, __pyx_n_s_cASMFactor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 291, __pyx_L1_error)
5910  __Pyx_GOTREF(__pyx_t_3);
5911  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_10csmoothers_cASMFactor))))) __PYX_ERR(0, 291, __pyx_L1_error)
5912 
5913  /* "csmoothers.pyx":292
5914  * w,
5915  * asmFactor._cASMFactor,
5916  * node_order, # <<<<<<<<<<<<<<
5917  * R,
5918  * dX)
5919  */
5920  __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 292, __pyx_L1_error)
5921 
5922  /* "csmoothers.pyx":293
5923  * asmFactor._cASMFactor,
5924  * node_order,
5925  * R, # <<<<<<<<<<<<<<
5926  * dX)
5927  *
5928  */
5929  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 293, __pyx_L1_error)
5930 
5931  /* "csmoothers.pyx":294
5932  * node_order,
5933  * R,
5934  * dX) # <<<<<<<<<<<<<<
5935  *
5936  * cdef void smootherWrappers_asm_NR_solve(superluWrappers.cSparseMatrix sm,
5937  */
5938  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 294, __pyx_L1_error)
5939 
5940  /* "csmoothers.pyx":289
5941  * dX : np.array double
5942  * """
5943  * smootherWrappers_asm_NR_solve(A._cSparseMatrix, # <<<<<<<<<<<<<<
5944  * w,
5945  * asmFactor._cASMFactor,
5946  */
5947  __pyx_f_10csmoothers_smootherWrappers_asm_NR_solve(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, ((struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_t_3), __pyx_t_4, __pyx_t_5, __pyx_t_6);
5948  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5949  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5950  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
5951  __pyx_t_4.memview = NULL;
5952  __pyx_t_4.data = NULL;
5953  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
5954  __pyx_t_5.memview = NULL;
5955  __pyx_t_5.data = NULL;
5956  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5957  __pyx_t_6.memview = NULL;
5958  __pyx_t_6.data = NULL;
5959 
5960  /* "csmoothers.pyx":277
5961  * asmFactor.subdomain_pivots)
5962  *
5963  * def asm_NR_solve(A, w, asmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
5964  * """
5965  *
5966  */
5967 
5968  /* function exit code */
5969  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5970  goto __pyx_L0;
5971  __pyx_L1_error:;
5972  __Pyx_XDECREF(__pyx_t_1);
5973  __Pyx_XDECREF(__pyx_t_3);
5974  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
5975  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
5976  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5977  __Pyx_AddTraceback("csmoothers.asm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5978  __pyx_r = NULL;
5979  __pyx_L0:;
5980  __Pyx_XGIVEREF(__pyx_r);
5981  __Pyx_RefNannyFinishContext();
5982  return __pyx_r;
5983 }
5984 
5985 /* "csmoothers.pyx":296
5986  * dX)
5987  *
5988  * cdef void smootherWrappers_asm_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
5989  * double w,
5990  * cASMFactor asmFactor,
5991  */
5992 
5993 static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, double __pyx_v_w, struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_asmFactor, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
5994  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
5995  __Pyx_RefNannyDeclarations
5996  PyObject *__pyx_t_1 = NULL;
5997  int __pyx_t_2;
5998  Py_ssize_t __pyx_t_3;
5999  Py_ssize_t __pyx_t_4;
6000  Py_ssize_t __pyx_t_5;
6001  __Pyx_RefNannySetupContext("smootherWrappers_asm_NR_solve", 0);
6002 
6003  /* "csmoothers.pyx":303
6004  * DDATA dX):
6005  * cdef SuperMatrix AS
6006  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
6007  * AS.Dtype = superluWrappers._SLU_D
6008  * AS.Mtype = superluWrappers._SLU_GE
6009  */
6010  __pyx_v_AS.Stype = SLU_NR;
6011 
6012  /* "csmoothers.pyx":304
6013  * cdef SuperMatrix AS
6014  * AS.Stype = superluWrappers._SLU_NR
6015  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
6016  * AS.Mtype = superluWrappers._SLU_GE
6017  * AS.nrow = sm.nr
6018  */
6019  __pyx_v_AS.Dtype = SLU_D;
6020 
6021  /* "csmoothers.pyx":305
6022  * AS.Stype = superluWrappers._SLU_NR
6023  * AS.Dtype = superluWrappers._SLU_D
6024  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
6025  * AS.nrow = sm.nr
6026  * AS.ncol = sm.nc
6027  */
6028  __pyx_v_AS.Mtype = SLU_GE;
6029 
6030  /* "csmoothers.pyx":306
6031  * AS.Dtype = superluWrappers._SLU_D
6032  * AS.Mtype = superluWrappers._SLU_GE
6033  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
6034  * AS.ncol = sm.nc
6035  * AS.Store = &sm.A
6036  */
6037  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __pyx_L1_error)
6038  __Pyx_GOTREF(__pyx_t_1);
6039  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 306, __pyx_L1_error)
6040  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6041  __pyx_v_AS.nrow = __pyx_t_2;
6042 
6043  /* "csmoothers.pyx":307
6044  * AS.Mtype = superluWrappers._SLU_GE
6045  * AS.nrow = sm.nr
6046  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
6047  * AS.Store = &sm.A
6048  * casm_NR_solve(&AS,
6049  */
6050  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error)
6051  __Pyx_GOTREF(__pyx_t_1);
6052  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 307, __pyx_L1_error)
6053  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6054  __pyx_v_AS.ncol = __pyx_t_2;
6055 
6056  /* "csmoothers.pyx":308
6057  * AS.nrow = sm.nr
6058  * AS.ncol = sm.nc
6059  * AS.Store = &sm.A # <<<<<<<<<<<<<<
6060  * casm_NR_solve(&AS,
6061  * w,
6062  */
6063  __pyx_v_AS.Store = (&__pyx_v_sm->A);
6064 
6065  /* "csmoothers.pyx":314
6066  * asmFactor.subdomain_dim,
6067  * asmFactor.l2g_L,
6068  * &R[0], # <<<<<<<<<<<<<<
6069  * asmFactor.subdomain_R,
6070  * &node_order[0],
6071  */
6072  __pyx_t_3 = 0;
6073  __pyx_t_2 = -1;
6074  if (__pyx_t_3 < 0) {
6075  __pyx_t_3 += __pyx_v_R.shape[0];
6076  if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
6077  } else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
6078  if (unlikely(__pyx_t_2 != -1)) {
6079  __Pyx_RaiseBufferIndexError(__pyx_t_2);
6080  __PYX_ERR(0, 314, __pyx_L1_error)
6081  }
6082 
6083  /* "csmoothers.pyx":316
6084  * &R[0],
6085  * asmFactor.subdomain_R,
6086  * &node_order[0], # <<<<<<<<<<<<<<
6087  * asmFactor.subdomain_dX,
6088  * &dX[0],
6089  */
6090  __pyx_t_4 = 0;
6091  __pyx_t_2 = -1;
6092  if (__pyx_t_4 < 0) {
6093  __pyx_t_4 += __pyx_v_node_order.shape[0];
6094  if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
6095  } else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
6096  if (unlikely(__pyx_t_2 != -1)) {
6097  __Pyx_RaiseBufferIndexError(__pyx_t_2);
6098  __PYX_ERR(0, 316, __pyx_L1_error)
6099  }
6100 
6101  /* "csmoothers.pyx":318
6102  * &node_order[0],
6103  * asmFactor.subdomain_dX,
6104  * &dX[0], # <<<<<<<<<<<<<<
6105  * asmFactor.subdomain_pivots)
6106  *
6107  */
6108  __pyx_t_5 = 0;
6109  __pyx_t_2 = -1;
6110  if (__pyx_t_5 < 0) {
6111  __pyx_t_5 += __pyx_v_dX.shape[0];
6112  if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
6113  } else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
6114  if (unlikely(__pyx_t_2 != -1)) {
6115  __Pyx_RaiseBufferIndexError(__pyx_t_2);
6116  __PYX_ERR(0, 318, __pyx_L1_error)
6117  }
6118 
6119  /* "csmoothers.pyx":309
6120  * AS.ncol = sm.nc
6121  * AS.Store = &sm.A
6122  * casm_NR_solve(&AS, # <<<<<<<<<<<<<<
6123  * w,
6124  * asmFactor.subdomain_L,
6125  */
6126  asm_NR_solve((&__pyx_v_AS), __pyx_v_w, __pyx_v_asmFactor->subdomain_L, __pyx_v_asmFactor->subdomain_dim, __pyx_v_asmFactor->l2g_L, (&(*((double *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), __pyx_v_asmFactor->subdomain_R, (&(*((int *) ( /* dim=0 */ (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_asmFactor->subdomain_dX, (&(*((double *) ( /* dim=0 */ (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))), __pyx_v_asmFactor->subdomain_pivots);
6127 
6128  /* "csmoothers.pyx":296
6129  * dX)
6130  *
6131  * cdef void smootherWrappers_asm_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
6132  * double w,
6133  * cASMFactor asmFactor,
6134  */
6135 
6136  /* function exit code */
6137  goto __pyx_L0;
6138  __pyx_L1_error:;
6139  __Pyx_XDECREF(__pyx_t_1);
6140  __Pyx_WriteUnraisable("csmoothers.smootherWrappers_asm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6141  __pyx_L0:;
6142  __Pyx_RefNannyFinishContext();
6143 }
6144 
6145 /* "csmoothers.pyx":321
6146  * asmFactor.subdomain_pivots)
6147  *
6148  * def basm_NR_prepare(A, basmFactor): # <<<<<<<<<<<<<<
6149  * """
6150  *
6151  */
6152 
6153 /* Python wrapper */
6154 static PyObject *__pyx_pw_10csmoothers_17basm_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6155 static char __pyx_doc_10csmoothers_16basm_NR_prepare[] = "\n\n Arguments\n ---------\n A :\n basmFactor :\n ";
6156 static PyMethodDef __pyx_mdef_10csmoothers_17basm_NR_prepare = {"basm_NR_prepare", (PyCFunction)__pyx_pw_10csmoothers_17basm_NR_prepare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_16basm_NR_prepare};
6157 static PyObject *__pyx_pw_10csmoothers_17basm_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6158  PyObject *__pyx_v_A = 0;
6159  PyObject *__pyx_v_basmFactor = 0;
6160  PyObject *__pyx_r = 0;
6161  __Pyx_RefNannyDeclarations
6162  __Pyx_RefNannySetupContext("basm_NR_prepare (wrapper)", 0);
6163  {
6164  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_basmFactor,0};
6165  PyObject* values[2] = {0,0};
6166  if (unlikely(__pyx_kwds)) {
6167  Py_ssize_t kw_args;
6168  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6169  switch (pos_args) {
6170  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6171  CYTHON_FALLTHROUGH;
6172  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6173  CYTHON_FALLTHROUGH;
6174  case 0: break;
6175  default: goto __pyx_L5_argtuple_error;
6176  }
6177  kw_args = PyDict_Size(__pyx_kwds);
6178  switch (pos_args) {
6179  case 0:
6180  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
6181  else goto __pyx_L5_argtuple_error;
6182  CYTHON_FALLTHROUGH;
6183  case 1:
6184  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_basmFactor)) != 0)) kw_args--;
6185  else {
6186  __Pyx_RaiseArgtupleInvalid("basm_NR_prepare", 1, 2, 2, 1); __PYX_ERR(0, 321, __pyx_L3_error)
6187  }
6188  }
6189  if (unlikely(kw_args > 0)) {
6190  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "basm_NR_prepare") < 0)) __PYX_ERR(0, 321, __pyx_L3_error)
6191  }
6192  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
6193  goto __pyx_L5_argtuple_error;
6194  } else {
6195  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6196  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6197  }
6198  __pyx_v_A = values[0];
6199  __pyx_v_basmFactor = values[1];
6200  }
6201  goto __pyx_L4_argument_unpacking_done;
6202  __pyx_L5_argtuple_error:;
6203  __Pyx_RaiseArgtupleInvalid("basm_NR_prepare", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 321, __pyx_L3_error)
6204  __pyx_L3_error:;
6205  __Pyx_AddTraceback("csmoothers.basm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
6206  __Pyx_RefNannyFinishContext();
6207  return NULL;
6208  __pyx_L4_argument_unpacking_done:;
6209  __pyx_r = __pyx_pf_10csmoothers_16basm_NR_prepare(__pyx_self, __pyx_v_A, __pyx_v_basmFactor);
6210 
6211  /* function exit code */
6212  __Pyx_RefNannyFinishContext();
6213  return __pyx_r;
6214 }
6215 
6216 static PyObject *__pyx_pf_10csmoothers_16basm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_basmFactor) {
6217  PyObject *__pyx_r = NULL;
6218  __Pyx_RefNannyDeclarations
6219  PyObject *__pyx_t_1 = NULL;
6220  PyObject *__pyx_t_2 = NULL;
6221  __Pyx_RefNannySetupContext("basm_NR_prepare", 0);
6222 
6223  /* "csmoothers.pyx":329
6224  * basmFactor :
6225  * """
6226  * smootherWrappers_basm_NR_prepare(A._cSparseMatrix, # <<<<<<<<<<<<<<
6227  * basmFactor._cBASMFactor)
6228  *
6229  */
6230  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error)
6231  __Pyx_GOTREF(__pyx_t_1);
6232  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 329, __pyx_L1_error)
6233 
6234  /* "csmoothers.pyx":330
6235  * """
6236  * smootherWrappers_basm_NR_prepare(A._cSparseMatrix,
6237  * basmFactor._cBASMFactor) # <<<<<<<<<<<<<<
6238  *
6239  * cdef void smootherWrappers_basm_NR_prepare(superluWrappers.cSparseMatrix sm,
6240  */
6241  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_basmFactor, __pyx_n_s_cBASMFactor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L1_error)
6242  __Pyx_GOTREF(__pyx_t_2);
6243  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10csmoothers_cBASMFactor))))) __PYX_ERR(0, 330, __pyx_L1_error)
6244 
6245  /* "csmoothers.pyx":329
6246  * basmFactor :
6247  * """
6248  * smootherWrappers_basm_NR_prepare(A._cSparseMatrix, # <<<<<<<<<<<<<<
6249  * basmFactor._cBASMFactor)
6250  *
6251  */
6252  __pyx_f_10csmoothers_smootherWrappers_basm_NR_prepare(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), ((struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_t_2));
6253  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6254  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6255 
6256  /* "csmoothers.pyx":321
6257  * asmFactor.subdomain_pivots)
6258  *
6259  * def basm_NR_prepare(A, basmFactor): # <<<<<<<<<<<<<<
6260  * """
6261  *
6262  */
6263 
6264  /* function exit code */
6265  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6266  goto __pyx_L0;
6267  __pyx_L1_error:;
6268  __Pyx_XDECREF(__pyx_t_1);
6269  __Pyx_XDECREF(__pyx_t_2);
6270  __Pyx_AddTraceback("csmoothers.basm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
6271  __pyx_r = NULL;
6272  __pyx_L0:;
6273  __Pyx_XGIVEREF(__pyx_r);
6274  __Pyx_RefNannyFinishContext();
6275  return __pyx_r;
6276 }
6277 
6278 /* "csmoothers.pyx":332
6279  * basmFactor._cBASMFactor)
6280  *
6281  * cdef void smootherWrappers_basm_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
6282  * cBASMFactor basmFactor):
6283  * cdef SuperMatrix AS
6284  */
6285 
6286 static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_basmFactor) {
6287  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
6288  __Pyx_RefNannyDeclarations
6289  PyObject *__pyx_t_1 = NULL;
6290  int __pyx_t_2;
6291  __Pyx_RefNannySetupContext("smootherWrappers_basm_NR_prepare", 0);
6292 
6293  /* "csmoothers.pyx":335
6294  * cBASMFactor basmFactor):
6295  * cdef SuperMatrix AS
6296  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
6297  * AS.Mtype = superluWrappers._SLU_GE
6298  * AS.nrow = sm.nr
6299  */
6300  __pyx_v_AS.Dtype = SLU_D;
6301 
6302  /* "csmoothers.pyx":336
6303  * cdef SuperMatrix AS
6304  * AS.Dtype = superluWrappers._SLU_D
6305  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
6306  * AS.nrow = sm.nr
6307  * AS.ncol = sm.nc
6308  */
6309  __pyx_v_AS.Mtype = SLU_GE;
6310 
6311  /* "csmoothers.pyx":337
6312  * AS.Dtype = superluWrappers._SLU_D
6313  * AS.Mtype = superluWrappers._SLU_GE
6314  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
6315  * AS.ncol = sm.nc
6316  * AS.Store = &sm.A
6317  */
6318  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
6319  __Pyx_GOTREF(__pyx_t_1);
6320  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L1_error)
6321  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6322  __pyx_v_AS.nrow = __pyx_t_2;
6323 
6324  /* "csmoothers.pyx":338
6325  * AS.Mtype = superluWrappers._SLU_GE
6326  * AS.nrow = sm.nr
6327  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
6328  * AS.Store = &sm.A
6329  * cbasm_NR_prepare(basmFactor.bs,
6330  */
6331  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 338, __pyx_L1_error)
6332  __Pyx_GOTREF(__pyx_t_1);
6333  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L1_error)
6334  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6335  __pyx_v_AS.ncol = __pyx_t_2;
6336 
6337  /* "csmoothers.pyx":339
6338  * AS.nrow = sm.nr
6339  * AS.ncol = sm.nc
6340  * AS.Store = &sm.A # <<<<<<<<<<<<<<
6341  * cbasm_NR_prepare(basmFactor.bs,
6342  * basmFactor.N,
6343  */
6344  __pyx_v_AS.Store = (&__pyx_v_sm->A);
6345 
6346  /* "csmoothers.pyx":340
6347  * AS.ncol = sm.nc
6348  * AS.Store = &sm.A
6349  * cbasm_NR_prepare(basmFactor.bs, # <<<<<<<<<<<<<<
6350  * basmFactor.N,
6351  * &AS,
6352  */
6353  basm_NR_prepare(__pyx_v_basmFactor->bs, __pyx_v_basmFactor->N, (&__pyx_v_AS), __pyx_v_basmFactor->subdomain_dim, __pyx_v_basmFactor->l2g_L, __pyx_v_basmFactor->subdomain_L, __pyx_v_basmFactor->subdomain_pivots, __pyx_v_basmFactor->subdomain_col_pivots);
6354 
6355  /* "csmoothers.pyx":332
6356  * basmFactor._cBASMFactor)
6357  *
6358  * cdef void smootherWrappers_basm_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
6359  * cBASMFactor basmFactor):
6360  * cdef SuperMatrix AS
6361  */
6362 
6363  /* function exit code */
6364  goto __pyx_L0;
6365  __pyx_L1_error:;
6366  __Pyx_XDECREF(__pyx_t_1);
6367  __Pyx_WriteUnraisable("csmoothers.smootherWrappers_basm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6368  __pyx_L0:;
6369  __Pyx_RefNannyFinishContext();
6370 }
6371 
6372 /* "csmoothers.pyx":350
6373  *
6374  *
6375  * def basm_NR_solve(A, w, basmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
6376  * """
6377  *
6378  */
6379 
6380 /* Python wrapper */
6381 static PyObject *__pyx_pw_10csmoothers_19basm_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6382 static char __pyx_doc_10csmoothers_18basm_NR_solve[] = "\n \n Arguments\n ---------\n A :\n w :\n basmFactor :\n node_order :\n R :\n dX :\n ";
6383 static PyMethodDef __pyx_mdef_10csmoothers_19basm_NR_solve = {"basm_NR_solve", (PyCFunction)__pyx_pw_10csmoothers_19basm_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_18basm_NR_solve};
6384 static PyObject *__pyx_pw_10csmoothers_19basm_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6385  PyObject *__pyx_v_A = 0;
6386  PyObject *__pyx_v_w = 0;
6387  PyObject *__pyx_v_basmFactor = 0;
6388  PyObject *__pyx_v_node_order = 0;
6389  PyObject *__pyx_v_R = 0;
6390  PyObject *__pyx_v_dX = 0;
6391  PyObject *__pyx_r = 0;
6392  __Pyx_RefNannyDeclarations
6393  __Pyx_RefNannySetupContext("basm_NR_solve (wrapper)", 0);
6394  {
6395  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_w,&__pyx_n_s_basmFactor,&__pyx_n_s_node_order,&__pyx_n_s_R,&__pyx_n_s_dX,0};
6396  PyObject* values[6] = {0,0,0,0,0,0};
6397  if (unlikely(__pyx_kwds)) {
6398  Py_ssize_t kw_args;
6399  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6400  switch (pos_args) {
6401  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6402  CYTHON_FALLTHROUGH;
6403  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6404  CYTHON_FALLTHROUGH;
6405  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6406  CYTHON_FALLTHROUGH;
6407  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6408  CYTHON_FALLTHROUGH;
6409  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6410  CYTHON_FALLTHROUGH;
6411  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6412  CYTHON_FALLTHROUGH;
6413  case 0: break;
6414  default: goto __pyx_L5_argtuple_error;
6415  }
6416  kw_args = PyDict_Size(__pyx_kwds);
6417  switch (pos_args) {
6418  case 0:
6419  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
6420  else goto __pyx_L5_argtuple_error;
6421  CYTHON_FALLTHROUGH;
6422  case 1:
6423  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
6424  else {
6425  __Pyx_RaiseArgtupleInvalid("basm_NR_solve", 1, 6, 6, 1); __PYX_ERR(0, 350, __pyx_L3_error)
6426  }
6427  CYTHON_FALLTHROUGH;
6428  case 2:
6429  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_basmFactor)) != 0)) kw_args--;
6430  else {
6431  __Pyx_RaiseArgtupleInvalid("basm_NR_solve", 1, 6, 6, 2); __PYX_ERR(0, 350, __pyx_L3_error)
6432  }
6433  CYTHON_FALLTHROUGH;
6434  case 3:
6435  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
6436  else {
6437  __Pyx_RaiseArgtupleInvalid("basm_NR_solve", 1, 6, 6, 3); __PYX_ERR(0, 350, __pyx_L3_error)
6438  }
6439  CYTHON_FALLTHROUGH;
6440  case 4:
6441  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
6442  else {
6443  __Pyx_RaiseArgtupleInvalid("basm_NR_solve", 1, 6, 6, 4); __PYX_ERR(0, 350, __pyx_L3_error)
6444  }
6445  CYTHON_FALLTHROUGH;
6446  case 5:
6447  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
6448  else {
6449  __Pyx_RaiseArgtupleInvalid("basm_NR_solve", 1, 6, 6, 5); __PYX_ERR(0, 350, __pyx_L3_error)
6450  }
6451  }
6452  if (unlikely(kw_args > 0)) {
6453  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "basm_NR_solve") < 0)) __PYX_ERR(0, 350, __pyx_L3_error)
6454  }
6455  } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
6456  goto __pyx_L5_argtuple_error;
6457  } else {
6458  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6459  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6460  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6461  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6462  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6463  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6464  }
6465  __pyx_v_A = values[0];
6466  __pyx_v_w = values[1];
6467  __pyx_v_basmFactor = values[2];
6468  __pyx_v_node_order = values[3];
6469  __pyx_v_R = values[4];
6470  __pyx_v_dX = values[5];
6471  }
6472  goto __pyx_L4_argument_unpacking_done;
6473  __pyx_L5_argtuple_error:;
6474  __Pyx_RaiseArgtupleInvalid("basm_NR_solve", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 350, __pyx_L3_error)
6475  __pyx_L3_error:;
6476  __Pyx_AddTraceback("csmoothers.basm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
6477  __Pyx_RefNannyFinishContext();
6478  return NULL;
6479  __pyx_L4_argument_unpacking_done:;
6480  __pyx_r = __pyx_pf_10csmoothers_18basm_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_basmFactor, __pyx_v_node_order, __pyx_v_R, __pyx_v_dX);
6481 
6482  /* function exit code */
6483  __Pyx_RefNannyFinishContext();
6484  return __pyx_r;
6485 }
6486 
6487 static PyObject *__pyx_pf_10csmoothers_18basm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_basmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX) {
6488  PyObject *__pyx_r = NULL;
6489  __Pyx_RefNannyDeclarations
6490  PyObject *__pyx_t_1 = NULL;
6491  double __pyx_t_2;
6492  PyObject *__pyx_t_3 = NULL;
6493  __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
6494  __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
6495  __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
6496  __Pyx_RefNannySetupContext("basm_NR_solve", 0);
6497 
6498  /* "csmoothers.pyx":362
6499  * dX :
6500  * """
6501  * smootherWrappers_basm_NR_solve(A._cSparseMatrix, # <<<<<<<<<<<<<<
6502  * w,
6503  * basmFactor._cBASMFactor,
6504  */
6505  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error)
6506  __Pyx_GOTREF(__pyx_t_1);
6507  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 362, __pyx_L1_error)
6508 
6509  /* "csmoothers.pyx":363
6510  * """
6511  * smootherWrappers_basm_NR_solve(A._cSparseMatrix,
6512  * w, # <<<<<<<<<<<<<<
6513  * basmFactor._cBASMFactor,
6514  * node_order,
6515  */
6516  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_w); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L1_error)
6517 
6518  /* "csmoothers.pyx":364
6519  * smootherWrappers_basm_NR_solve(A._cSparseMatrix,
6520  * w,
6521  * basmFactor._cBASMFactor, # <<<<<<<<<<<<<<
6522  * node_order,
6523  * R,
6524  */
6525  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_basmFactor, __pyx_n_s_cBASMFactor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 364, __pyx_L1_error)
6526  __Pyx_GOTREF(__pyx_t_3);
6527  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_10csmoothers_cBASMFactor))))) __PYX_ERR(0, 364, __pyx_L1_error)
6528 
6529  /* "csmoothers.pyx":365
6530  * w,
6531  * basmFactor._cBASMFactor,
6532  * node_order, # <<<<<<<<<<<<<<
6533  * R,
6534  * dX)
6535  */
6536  __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 365, __pyx_L1_error)
6537 
6538  /* "csmoothers.pyx":366
6539  * basmFactor._cBASMFactor,
6540  * node_order,
6541  * R, # <<<<<<<<<<<<<<
6542  * dX)
6543  *
6544  */
6545  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 366, __pyx_L1_error)
6546 
6547  /* "csmoothers.pyx":367
6548  * node_order,
6549  * R,
6550  * dX) # <<<<<<<<<<<<<<
6551  *
6552  * cdef void smootherWrappers_basm_NR_solve(superluWrappers.cSparseMatrix sm,
6553  */
6554  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 367, __pyx_L1_error)
6555 
6556  /* "csmoothers.pyx":362
6557  * dX :
6558  * """
6559  * smootherWrappers_basm_NR_solve(A._cSparseMatrix, # <<<<<<<<<<<<<<
6560  * w,
6561  * basmFactor._cBASMFactor,
6562  */
6563  __pyx_f_10csmoothers_smootherWrappers_basm_NR_solve(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, ((struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_t_3), __pyx_t_4, __pyx_t_5, __pyx_t_6);
6564  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6565  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6566  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
6567  __pyx_t_4.memview = NULL;
6568  __pyx_t_4.data = NULL;
6569  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
6570  __pyx_t_5.memview = NULL;
6571  __pyx_t_5.data = NULL;
6572  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6573  __pyx_t_6.memview = NULL;
6574  __pyx_t_6.data = NULL;
6575 
6576  /* "csmoothers.pyx":350
6577  *
6578  *
6579  * def basm_NR_solve(A, w, basmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
6580  * """
6581  *
6582  */
6583 
6584  /* function exit code */
6585  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6586  goto __pyx_L0;
6587  __pyx_L1_error:;
6588  __Pyx_XDECREF(__pyx_t_1);
6589  __Pyx_XDECREF(__pyx_t_3);
6590  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
6591  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
6592  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6593  __Pyx_AddTraceback("csmoothers.basm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
6594  __pyx_r = NULL;
6595  __pyx_L0:;
6596  __Pyx_XGIVEREF(__pyx_r);
6597  __Pyx_RefNannyFinishContext();
6598  return __pyx_r;
6599 }
6600 
6601 /* "csmoothers.pyx":369
6602  * dX)
6603  *
6604  * cdef void smootherWrappers_basm_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
6605  * double w,
6606  * cBASMFactor basmFactor,
6607  */
6608 
6609 static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, double __pyx_v_w, struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_basmFactor, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
6610  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
6611  __Pyx_RefNannyDeclarations
6612  PyObject *__pyx_t_1 = NULL;
6613  int __pyx_t_2;
6614  Py_ssize_t __pyx_t_3;
6615  Py_ssize_t __pyx_t_4;
6616  Py_ssize_t __pyx_t_5;
6617  __Pyx_RefNannySetupContext("smootherWrappers_basm_NR_solve", 0);
6618 
6619  /* "csmoothers.pyx":376
6620  * DDATA dX):
6621  * cdef SuperMatrix AS
6622  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
6623  * AS.Dtype = superluWrappers._SLU_D
6624  * AS.Mtype = superluWrappers._SLU_GE
6625  */
6626  __pyx_v_AS.Stype = SLU_NR;
6627 
6628  /* "csmoothers.pyx":377
6629  * cdef SuperMatrix AS
6630  * AS.Stype = superluWrappers._SLU_NR
6631  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
6632  * AS.Mtype = superluWrappers._SLU_GE
6633  * AS.nrow = sm.nr
6634  */
6635  __pyx_v_AS.Dtype = SLU_D;
6636 
6637  /* "csmoothers.pyx":378
6638  * AS.Stype = superluWrappers._SLU_NR
6639  * AS.Dtype = superluWrappers._SLU_D
6640  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
6641  * AS.nrow = sm.nr
6642  * AS.ncol = sm.nc
6643  */
6644  __pyx_v_AS.Mtype = SLU_GE;
6645 
6646  /* "csmoothers.pyx":379
6647  * AS.Dtype = superluWrappers._SLU_D
6648  * AS.Mtype = superluWrappers._SLU_GE
6649  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
6650  * AS.ncol = sm.nc
6651  * AS.Store = &sm.A
6652  */
6653  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error)
6654  __Pyx_GOTREF(__pyx_t_1);
6655  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 379, __pyx_L1_error)
6656  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6657  __pyx_v_AS.nrow = __pyx_t_2;
6658 
6659  /* "csmoothers.pyx":380
6660  * AS.Mtype = superluWrappers._SLU_GE
6661  * AS.nrow = sm.nr
6662  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
6663  * AS.Store = &sm.A
6664  * cbasm_NR_solve(basmFactor.bs,
6665  */
6666  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error)
6667  __Pyx_GOTREF(__pyx_t_1);
6668  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 380, __pyx_L1_error)
6669  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6670  __pyx_v_AS.ncol = __pyx_t_2;
6671 
6672  /* "csmoothers.pyx":381
6673  * AS.nrow = sm.nr
6674  * AS.ncol = sm.nc
6675  * AS.Store = &sm.A # <<<<<<<<<<<<<<
6676  * cbasm_NR_solve(basmFactor.bs,
6677  * basmFactor.N,
6678  */
6679  __pyx_v_AS.Store = (&__pyx_v_sm->A);
6680 
6681  /* "csmoothers.pyx":389
6682  * basmFactor.subdomain_dim,
6683  * basmFactor.l2g_L,
6684  * &R[0], # <<<<<<<<<<<<<<
6685  * basmFactor.subdomain_R,
6686  * &node_order[0],
6687  */
6688  __pyx_t_3 = 0;
6689  __pyx_t_2 = -1;
6690  if (__pyx_t_3 < 0) {
6691  __pyx_t_3 += __pyx_v_R.shape[0];
6692  if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
6693  } else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
6694  if (unlikely(__pyx_t_2 != -1)) {
6695  __Pyx_RaiseBufferIndexError(__pyx_t_2);
6696  __PYX_ERR(0, 389, __pyx_L1_error)
6697  }
6698 
6699  /* "csmoothers.pyx":391
6700  * &R[0],
6701  * basmFactor.subdomain_R,
6702  * &node_order[0], # <<<<<<<<<<<<<<
6703  * basmFactor.subdomain_dX,
6704  * &dX[0],
6705  */
6706  __pyx_t_4 = 0;
6707  __pyx_t_2 = -1;
6708  if (__pyx_t_4 < 0) {
6709  __pyx_t_4 += __pyx_v_node_order.shape[0];
6710  if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
6711  } else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
6712  if (unlikely(__pyx_t_2 != -1)) {
6713  __Pyx_RaiseBufferIndexError(__pyx_t_2);
6714  __PYX_ERR(0, 391, __pyx_L1_error)
6715  }
6716 
6717  /* "csmoothers.pyx":393
6718  * &node_order[0],
6719  * basmFactor.subdomain_dX,
6720  * &dX[0], # <<<<<<<<<<<<<<
6721  * basmFactor.subdomain_pivots,
6722  * basmFactor.subdomain_col_pivots)
6723  */
6724  __pyx_t_5 = 0;
6725  __pyx_t_2 = -1;
6726  if (__pyx_t_5 < 0) {
6727  __pyx_t_5 += __pyx_v_dX.shape[0];
6728  if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
6729  } else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
6730  if (unlikely(__pyx_t_2 != -1)) {
6731  __Pyx_RaiseBufferIndexError(__pyx_t_2);
6732  __PYX_ERR(0, 393, __pyx_L1_error)
6733  }
6734 
6735  /* "csmoothers.pyx":382
6736  * AS.ncol = sm.nc
6737  * AS.Store = &sm.A
6738  * cbasm_NR_solve(basmFactor.bs, # <<<<<<<<<<<<<<
6739  * basmFactor.N,
6740  * &AS,
6741  */
6742  basm_NR_solve(__pyx_v_basmFactor->bs, __pyx_v_basmFactor->N, (&__pyx_v_AS), __pyx_v_w, __pyx_v_basmFactor->subdomain_L, __pyx_v_basmFactor->subdomain_dim, __pyx_v_basmFactor->l2g_L, (&(*((double *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), __pyx_v_basmFactor->subdomain_R, (&(*((int *) ( /* dim=0 */ (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_basmFactor->subdomain_dX, (&(*((double *) ( /* dim=0 */ (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))), __pyx_v_basmFactor->subdomain_pivots, __pyx_v_basmFactor->subdomain_col_pivots);
6743 
6744  /* "csmoothers.pyx":369
6745  * dX)
6746  *
6747  * cdef void smootherWrappers_basm_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
6748  * double w,
6749  * cBASMFactor basmFactor,
6750  */
6751 
6752  /* function exit code */
6753  goto __pyx_L0;
6754  __pyx_L1_error:;
6755  __Pyx_XDECREF(__pyx_t_1);
6756  __Pyx_WriteUnraisable("csmoothers.smootherWrappers_basm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6757  __pyx_L0:;
6758  __Pyx_RefNannyFinishContext();
6759 }
6760 
6761 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":215
6762  * # experimental exception made for __getbuffer__ and __releasebuffer__
6763  * # -- the details of this may change.
6764  * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
6765  * # This implementation of getbuffer is geared towards Cython
6766  * # requirements, and does not yet fulfill the PEP.
6767  */
6768 
6769 /* Python wrapper */
6770 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
6771 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
6772  int __pyx_r;
6773  __Pyx_RefNannyDeclarations
6774  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
6775  __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
6776 
6777  /* function exit code */
6778  __Pyx_RefNannyFinishContext();
6779  return __pyx_r;
6780 }
6781 
6782 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
6783  int __pyx_v_i;
6784  int __pyx_v_ndim;
6785  int __pyx_v_endian_detector;
6786  int __pyx_v_little_endian;
6787  int __pyx_v_t;
6788  char *__pyx_v_f;
6789  PyArray_Descr *__pyx_v_descr = 0;
6790  int __pyx_v_offset;
6791  int __pyx_r;
6792  __Pyx_RefNannyDeclarations
6793  int __pyx_t_1;
6794  int __pyx_t_2;
6795  PyObject *__pyx_t_3 = NULL;
6796  int __pyx_t_4;
6797  int __pyx_t_5;
6798  int __pyx_t_6;
6799  PyObject *__pyx_t_7 = NULL;
6800  char *__pyx_t_8;
6801  if (__pyx_v_info == NULL) {
6802  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
6803  return -1;
6804  }
6805  __Pyx_RefNannySetupContext("__getbuffer__", 0);
6806  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
6807  __Pyx_GIVEREF(__pyx_v_info->obj);
6808 
6809  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222
6810  *
6811  * cdef int i, ndim
6812  * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
6813  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
6814  *
6815  */
6816  __pyx_v_endian_detector = 1;
6817 
6818  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":223
6819  * cdef int i, ndim
6820  * cdef int endian_detector = 1
6821  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
6822  *
6823  * ndim = PyArray_NDIM(self)
6824  */
6825  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
6826 
6827  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":225
6828  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
6829  *
6830  * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<<
6831  *
6832  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
6833  */
6834  __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
6835 
6836  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":227
6837  * ndim = PyArray_NDIM(self)
6838  *
6839  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
6840  * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
6841  * raise ValueError(u"ndarray is not C contiguous")
6842  */
6843  __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
6844  if (__pyx_t_2) {
6845  } else {
6846  __pyx_t_1 = __pyx_t_2;
6847  goto __pyx_L4_bool_binop_done;
6848  }
6849 
6850  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":228
6851  *
6852  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
6853  * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<<
6854  * raise ValueError(u"ndarray is not C contiguous")
6855  *
6856  */
6857  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
6858  __pyx_t_1 = __pyx_t_2;
6859  __pyx_L4_bool_binop_done:;
6860 
6861  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":227
6862  * ndim = PyArray_NDIM(self)
6863  *
6864  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
6865  * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
6866  * raise ValueError(u"ndarray is not C contiguous")
6867  */
6868  if (unlikely(__pyx_t_1)) {
6869 
6870  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":229
6871  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
6872  * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
6873  * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
6874  *
6875  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
6876  */
6877  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 229, __pyx_L1_error)
6878  __Pyx_GOTREF(__pyx_t_3);
6879  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6880  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6881  __PYX_ERR(2, 229, __pyx_L1_error)
6882 
6883  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":227
6884  * ndim = PyArray_NDIM(self)
6885  *
6886  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
6887  * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
6888  * raise ValueError(u"ndarray is not C contiguous")
6889  */
6890  }
6891 
6892  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":231
6893  * raise ValueError(u"ndarray is not C contiguous")
6894  *
6895  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
6896  * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
6897  * raise ValueError(u"ndarray is not Fortran contiguous")
6898  */
6899  __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
6900  if (__pyx_t_2) {
6901  } else {
6902  __pyx_t_1 = __pyx_t_2;
6903  goto __pyx_L7_bool_binop_done;
6904  }
6905 
6906  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":232
6907  *
6908  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
6909  * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<<
6910  * raise ValueError(u"ndarray is not Fortran contiguous")
6911  *
6912  */
6913  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
6914  __pyx_t_1 = __pyx_t_2;
6915  __pyx_L7_bool_binop_done:;
6916 
6917  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":231
6918  * raise ValueError(u"ndarray is not C contiguous")
6919  *
6920  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
6921  * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
6922  * raise ValueError(u"ndarray is not Fortran contiguous")
6923  */
6924  if (unlikely(__pyx_t_1)) {
6925 
6926  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":233
6927  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
6928  * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
6929  * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
6930  *
6931  * info.buf = PyArray_DATA(self)
6932  */
6933  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 233, __pyx_L1_error)
6934  __Pyx_GOTREF(__pyx_t_3);
6935  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6936  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6937  __PYX_ERR(2, 233, __pyx_L1_error)
6938 
6939  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":231
6940  * raise ValueError(u"ndarray is not C contiguous")
6941  *
6942  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
6943  * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
6944  * raise ValueError(u"ndarray is not Fortran contiguous")
6945  */
6946  }
6947 
6948  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":235
6949  * raise ValueError(u"ndarray is not Fortran contiguous")
6950  *
6951  * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<<
6952  * info.ndim = ndim
6953  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
6954  */
6955  __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
6956 
6957  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":236
6958  *
6959  * info.buf = PyArray_DATA(self)
6960  * info.ndim = ndim # <<<<<<<<<<<<<<
6961  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
6962  * # Allocate new buffer for strides and shape info.
6963  */
6964  __pyx_v_info->ndim = __pyx_v_ndim;
6965 
6966  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":237
6967  * info.buf = PyArray_DATA(self)
6968  * info.ndim = ndim
6969  * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
6970  * # Allocate new buffer for strides and shape info.
6971  * # This is allocated as one block, strides first.
6972  */
6973  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
6974  if (__pyx_t_1) {
6975 
6976  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":240
6977  * # Allocate new buffer for strides and shape info.
6978  * # This is allocated as one block, strides first.
6979  * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim) # <<<<<<<<<<<<<<
6980  * info.shape = info.strides + ndim
6981  * for i in range(ndim):
6982  */
6983  __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim))));
6984 
6985  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":241
6986  * # This is allocated as one block, strides first.
6987  * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
6988  * info.shape = info.strides + ndim # <<<<<<<<<<<<<<
6989  * for i in range(ndim):
6990  * info.strides[i] = PyArray_STRIDES(self)[i]
6991  */
6992  __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
6993 
6994  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":242
6995  * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
6996  * info.shape = info.strides + ndim
6997  * for i in range(ndim): # <<<<<<<<<<<<<<
6998  * info.strides[i] = PyArray_STRIDES(self)[i]
6999  * info.shape[i] = PyArray_DIMS(self)[i]
7000  */
7001  __pyx_t_4 = __pyx_v_ndim;
7002  __pyx_t_5 = __pyx_t_4;
7003  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
7004  __pyx_v_i = __pyx_t_6;
7005 
7006  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":243
7007  * info.shape = info.strides + ndim
7008  * for i in range(ndim):
7009  * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<<
7010  * info.shape[i] = PyArray_DIMS(self)[i]
7011  * else:
7012  */
7013  (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
7014 
7015  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":244
7016  * for i in range(ndim):
7017  * info.strides[i] = PyArray_STRIDES(self)[i]
7018  * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<<
7019  * else:
7020  * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
7021  */
7022  (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
7023  }
7024 
7025  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":237
7026  * info.buf = PyArray_DATA(self)
7027  * info.ndim = ndim
7028  * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
7029  * # Allocate new buffer for strides and shape info.
7030  * # This is allocated as one block, strides first.
7031  */
7032  goto __pyx_L9;
7033  }
7034 
7035  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":246
7036  * info.shape[i] = PyArray_DIMS(self)[i]
7037  * else:
7038  * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) # <<<<<<<<<<<<<<
7039  * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
7040  * info.suboffsets = NULL
7041  */
7042  /*else*/ {
7043  __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
7044 
7045  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":247
7046  * else:
7047  * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
7048  * info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<<
7049  * info.suboffsets = NULL
7050  * info.itemsize = PyArray_ITEMSIZE(self)
7051  */
7052  __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
7053  }
7054  __pyx_L9:;
7055 
7056  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":248
7057  * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
7058  * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
7059  * info.suboffsets = NULL # <<<<<<<<<<<<<<
7060  * info.itemsize = PyArray_ITEMSIZE(self)
7061  * info.readonly = not PyArray_ISWRITEABLE(self)
7062  */
7063  __pyx_v_info->suboffsets = NULL;
7064 
7065  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":249
7066  * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
7067  * info.suboffsets = NULL
7068  * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<<
7069  * info.readonly = not PyArray_ISWRITEABLE(self)
7070  *
7071  */
7072  __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
7073 
7074  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":250
7075  * info.suboffsets = NULL
7076  * info.itemsize = PyArray_ITEMSIZE(self)
7077  * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<<
7078  *
7079  * cdef int t
7080  */
7081  __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
7082 
7083  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":253
7084  *
7085  * cdef int t
7086  * cdef char* f = NULL # <<<<<<<<<<<<<<
7087  * cdef dtype descr = self.descr
7088  * cdef int offset
7089  */
7090  __pyx_v_f = NULL;
7091 
7092  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":254
7093  * cdef int t
7094  * cdef char* f = NULL
7095  * cdef dtype descr = self.descr # <<<<<<<<<<<<<<
7096  * cdef int offset
7097  *
7098  */
7099  __pyx_t_3 = ((PyObject *)__pyx_v_self->descr);
7100  __Pyx_INCREF(__pyx_t_3);
7101  __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
7102  __pyx_t_3 = 0;
7103 
7104  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257
7105  * cdef int offset
7106  *
7107  * info.obj = self # <<<<<<<<<<<<<<
7108  *
7109  * if not PyDataType_HASFIELDS(descr):
7110  */
7111  __Pyx_INCREF(((PyObject *)__pyx_v_self));
7112  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
7113  __Pyx_GOTREF(__pyx_v_info->obj);
7114  __Pyx_DECREF(__pyx_v_info->obj);
7115  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
7116 
7117  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":259
7118  * info.obj = self
7119  *
7120  * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<<
7121  * t = descr.type_num
7122  * if ((descr.byteorder == c'>' and little_endian) or
7123  */
7124  __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0);
7125  if (__pyx_t_1) {
7126 
7127  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":260
7128  *
7129  * if not PyDataType_HASFIELDS(descr):
7130  * t = descr.type_num # <<<<<<<<<<<<<<
7131  * if ((descr.byteorder == c'>' and little_endian) or
7132  * (descr.byteorder == c'<' and not little_endian)):
7133  */
7134  __pyx_t_4 = __pyx_v_descr->type_num;
7135  __pyx_v_t = __pyx_t_4;
7136 
7137  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":261
7138  * if not PyDataType_HASFIELDS(descr):
7139  * t = descr.type_num
7140  * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
7141  * (descr.byteorder == c'<' and not little_endian)):
7142  * raise ValueError(u"Non-native byte order not supported")
7143  */
7144  __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
7145  if (!__pyx_t_2) {
7146  goto __pyx_L15_next_or;
7147  } else {
7148  }
7149  __pyx_t_2 = (__pyx_v_little_endian != 0);
7150  if (!__pyx_t_2) {
7151  } else {
7152  __pyx_t_1 = __pyx_t_2;
7153  goto __pyx_L14_bool_binop_done;
7154  }
7155  __pyx_L15_next_or:;
7156 
7157  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":262
7158  * t = descr.type_num
7159  * if ((descr.byteorder == c'>' and little_endian) or
7160  * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
7161  * raise ValueError(u"Non-native byte order not supported")
7162  * if t == NPY_BYTE: f = "b"
7163  */
7164  __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
7165  if (__pyx_t_2) {
7166  } else {
7167  __pyx_t_1 = __pyx_t_2;
7168  goto __pyx_L14_bool_binop_done;
7169  }
7170  __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
7171  __pyx_t_1 = __pyx_t_2;
7172  __pyx_L14_bool_binop_done:;
7173 
7174  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":261
7175  * if not PyDataType_HASFIELDS(descr):
7176  * t = descr.type_num
7177  * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
7178  * (descr.byteorder == c'<' and not little_endian)):
7179  * raise ValueError(u"Non-native byte order not supported")
7180  */
7181  if (unlikely(__pyx_t_1)) {
7182 
7183  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":263
7184  * if ((descr.byteorder == c'>' and little_endian) or
7185  * (descr.byteorder == c'<' and not little_endian)):
7186  * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
7187  * if t == NPY_BYTE: f = "b"
7188  * elif t == NPY_UBYTE: f = "B"
7189  */
7190  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 263, __pyx_L1_error)
7191  __Pyx_GOTREF(__pyx_t_3);
7192  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7193  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7194  __PYX_ERR(2, 263, __pyx_L1_error)
7195 
7196  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":261
7197  * if not PyDataType_HASFIELDS(descr):
7198  * t = descr.type_num
7199  * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
7200  * (descr.byteorder == c'<' and not little_endian)):
7201  * raise ValueError(u"Non-native byte order not supported")
7202  */
7203  }
7204 
7205  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":264
7206  * (descr.byteorder == c'<' and not little_endian)):
7207  * raise ValueError(u"Non-native byte order not supported")
7208  * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<<
7209  * elif t == NPY_UBYTE: f = "B"
7210  * elif t == NPY_SHORT: f = "h"
7211  */
7212  switch (__pyx_v_t) {
7213  case NPY_BYTE:
7214  __pyx_v_f = ((char *)"b");
7215  break;
7216 
7217  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":265
7218  * raise ValueError(u"Non-native byte order not supported")
7219  * if t == NPY_BYTE: f = "b"
7220  * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<<
7221  * elif t == NPY_SHORT: f = "h"
7222  * elif t == NPY_USHORT: f = "H"
7223  */
7224  case NPY_UBYTE:
7225  __pyx_v_f = ((char *)"B");
7226  break;
7227 
7228  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":266
7229  * if t == NPY_BYTE: f = "b"
7230  * elif t == NPY_UBYTE: f = "B"
7231  * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<<
7232  * elif t == NPY_USHORT: f = "H"
7233  * elif t == NPY_INT: f = "i"
7234  */
7235  case NPY_SHORT:
7236  __pyx_v_f = ((char *)"h");
7237  break;
7238 
7239  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":267
7240  * elif t == NPY_UBYTE: f = "B"
7241  * elif t == NPY_SHORT: f = "h"
7242  * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<<
7243  * elif t == NPY_INT: f = "i"
7244  * elif t == NPY_UINT: f = "I"
7245  */
7246  case NPY_USHORT:
7247  __pyx_v_f = ((char *)"H");
7248  break;
7249 
7250  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":268
7251  * elif t == NPY_SHORT: f = "h"
7252  * elif t == NPY_USHORT: f = "H"
7253  * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<<
7254  * elif t == NPY_UINT: f = "I"
7255  * elif t == NPY_LONG: f = "l"
7256  */
7257  case NPY_INT:
7258  __pyx_v_f = ((char *)"i");
7259  break;
7260 
7261  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":269
7262  * elif t == NPY_USHORT: f = "H"
7263  * elif t == NPY_INT: f = "i"
7264  * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<<
7265  * elif t == NPY_LONG: f = "l"
7266  * elif t == NPY_ULONG: f = "L"
7267  */
7268  case NPY_UINT:
7269  __pyx_v_f = ((char *)"I");
7270  break;
7271 
7272  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":270
7273  * elif t == NPY_INT: f = "i"
7274  * elif t == NPY_UINT: f = "I"
7275  * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<<
7276  * elif t == NPY_ULONG: f = "L"
7277  * elif t == NPY_LONGLONG: f = "q"
7278  */
7279  case NPY_LONG:
7280  __pyx_v_f = ((char *)"l");
7281  break;
7282 
7283  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":271
7284  * elif t == NPY_UINT: f = "I"
7285  * elif t == NPY_LONG: f = "l"
7286  * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<<
7287  * elif t == NPY_LONGLONG: f = "q"
7288  * elif t == NPY_ULONGLONG: f = "Q"
7289  */
7290  case NPY_ULONG:
7291  __pyx_v_f = ((char *)"L");
7292  break;
7293 
7294  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":272
7295  * elif t == NPY_LONG: f = "l"
7296  * elif t == NPY_ULONG: f = "L"
7297  * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<<
7298  * elif t == NPY_ULONGLONG: f = "Q"
7299  * elif t == NPY_FLOAT: f = "f"
7300  */
7301  case NPY_LONGLONG:
7302  __pyx_v_f = ((char *)"q");
7303  break;
7304 
7305  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":273
7306  * elif t == NPY_ULONG: f = "L"
7307  * elif t == NPY_LONGLONG: f = "q"
7308  * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<<
7309  * elif t == NPY_FLOAT: f = "f"
7310  * elif t == NPY_DOUBLE: f = "d"
7311  */
7312  case NPY_ULONGLONG:
7313  __pyx_v_f = ((char *)"Q");
7314  break;
7315 
7316  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
7317  * elif t == NPY_LONGLONG: f = "q"
7318  * elif t == NPY_ULONGLONG: f = "Q"
7319  * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<<
7320  * elif t == NPY_DOUBLE: f = "d"
7321  * elif t == NPY_LONGDOUBLE: f = "g"
7322  */
7323  case NPY_FLOAT:
7324  __pyx_v_f = ((char *)"f");
7325  break;
7326 
7327  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":275
7328  * elif t == NPY_ULONGLONG: f = "Q"
7329  * elif t == NPY_FLOAT: f = "f"
7330  * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<<
7331  * elif t == NPY_LONGDOUBLE: f = "g"
7332  * elif t == NPY_CFLOAT: f = "Zf"
7333  */
7334  case NPY_DOUBLE:
7335  __pyx_v_f = ((char *)"d");
7336  break;
7337 
7338  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":276
7339  * elif t == NPY_FLOAT: f = "f"
7340  * elif t == NPY_DOUBLE: f = "d"
7341  * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<<
7342  * elif t == NPY_CFLOAT: f = "Zf"
7343  * elif t == NPY_CDOUBLE: f = "Zd"
7344  */
7345  case NPY_LONGDOUBLE:
7346  __pyx_v_f = ((char *)"g");
7347  break;
7348 
7349  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":277
7350  * elif t == NPY_DOUBLE: f = "d"
7351  * elif t == NPY_LONGDOUBLE: f = "g"
7352  * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<<
7353  * elif t == NPY_CDOUBLE: f = "Zd"
7354  * elif t == NPY_CLONGDOUBLE: f = "Zg"
7355  */
7356  case NPY_CFLOAT:
7357  __pyx_v_f = ((char *)"Zf");
7358  break;
7359 
7360  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":278
7361  * elif t == NPY_LONGDOUBLE: f = "g"
7362  * elif t == NPY_CFLOAT: f = "Zf"
7363  * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<<
7364  * elif t == NPY_CLONGDOUBLE: f = "Zg"
7365  * elif t == NPY_OBJECT: f = "O"
7366  */
7367  case NPY_CDOUBLE:
7368  __pyx_v_f = ((char *)"Zd");
7369  break;
7370 
7371  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":279
7372  * elif t == NPY_CFLOAT: f = "Zf"
7373  * elif t == NPY_CDOUBLE: f = "Zd"
7374  * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<<
7375  * elif t == NPY_OBJECT: f = "O"
7376  * else:
7377  */
7378  case NPY_CLONGDOUBLE:
7379  __pyx_v_f = ((char *)"Zg");
7380  break;
7381 
7382  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":280
7383  * elif t == NPY_CDOUBLE: f = "Zd"
7384  * elif t == NPY_CLONGDOUBLE: f = "Zg"
7385  * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
7386  * else:
7387  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
7388  */
7389  case NPY_OBJECT:
7390  __pyx_v_f = ((char *)"O");
7391  break;
7392  default:
7393 
7394  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":282
7395  * elif t == NPY_OBJECT: f = "O"
7396  * else:
7397  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
7398  * info.format = f
7399  * return
7400  */
7401  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 282, __pyx_L1_error)
7402  __Pyx_GOTREF(__pyx_t_3);
7403  __pyx_t_7 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 282, __pyx_L1_error)
7404  __Pyx_GOTREF(__pyx_t_7);
7405  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7406  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 282, __pyx_L1_error)
7407  __Pyx_GOTREF(__pyx_t_3);
7408  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7409  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7410  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7411  __PYX_ERR(2, 282, __pyx_L1_error)
7412  break;
7413  }
7414 
7415  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":283
7416  * else:
7417  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
7418  * info.format = f # <<<<<<<<<<<<<<
7419  * return
7420  * else:
7421  */
7422  __pyx_v_info->format = __pyx_v_f;
7423 
7424  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":284
7425  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
7426  * info.format = f
7427  * return # <<<<<<<<<<<<<<
7428  * else:
7429  * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
7430  */
7431  __pyx_r = 0;
7432  goto __pyx_L0;
7433 
7434  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":259
7435  * info.obj = self
7436  *
7437  * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<<
7438  * t = descr.type_num
7439  * if ((descr.byteorder == c'>' and little_endian) or
7440  */
7441  }
7442 
7443  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":286
7444  * return
7445  * else:
7446  * info.format = <char*>PyObject_Malloc(_buffer_format_string_len) # <<<<<<<<<<<<<<
7447  * info.format[0] = c'^' # Native data types, manual alignment
7448  * offset = 0
7449  */
7450  /*else*/ {
7451  __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF));
7452 
7453  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":287
7454  * else:
7455  * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
7456  * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<<
7457  * offset = 0
7458  * f = _util_dtypestring(descr, info.format + 1,
7459  */
7460  (__pyx_v_info->format[0]) = '^';
7461 
7462  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":288
7463  * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
7464  * info.format[0] = c'^' # Native data types, manual alignment
7465  * offset = 0 # <<<<<<<<<<<<<<
7466  * f = _util_dtypestring(descr, info.format + 1,
7467  * info.format + _buffer_format_string_len,
7468  */
7469  __pyx_v_offset = 0;
7470 
7471  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":289
7472  * info.format[0] = c'^' # Native data types, manual alignment
7473  * offset = 0
7474  * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<<
7475  * info.format + _buffer_format_string_len,
7476  * &offset)
7477  */
7478  __pyx_t_8 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_8 == ((char *)NULL))) __PYX_ERR(2, 289, __pyx_L1_error)
7479  __pyx_v_f = __pyx_t_8;
7480 
7481  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":292
7482  * info.format + _buffer_format_string_len,
7483  * &offset)
7484  * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<<
7485  *
7486  * def __releasebuffer__(ndarray self, Py_buffer* info):
7487  */
7488  (__pyx_v_f[0]) = '\x00';
7489  }
7490 
7491  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":215
7492  * # experimental exception made for __getbuffer__ and __releasebuffer__
7493  * # -- the details of this may change.
7494  * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
7495  * # This implementation of getbuffer is geared towards Cython
7496  * # requirements, and does not yet fulfill the PEP.
7497  */
7498 
7499  /* function exit code */
7500  __pyx_r = 0;
7501  goto __pyx_L0;
7502  __pyx_L1_error:;
7503  __Pyx_XDECREF(__pyx_t_3);
7504  __Pyx_XDECREF(__pyx_t_7);
7505  __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7506  __pyx_r = -1;
7507  if (__pyx_v_info->obj != NULL) {
7508  __Pyx_GOTREF(__pyx_v_info->obj);
7509  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
7510  }
7511  goto __pyx_L2;
7512  __pyx_L0:;
7513  if (__pyx_v_info->obj == Py_None) {
7514  __Pyx_GOTREF(__pyx_v_info->obj);
7515  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
7516  }
7517  __pyx_L2:;
7518  __Pyx_XDECREF((PyObject *)__pyx_v_descr);
7519  __Pyx_RefNannyFinishContext();
7520  return __pyx_r;
7521 }
7522 
7523 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":294
7524  * f[0] = c'\0' # Terminate format string
7525  *
7526  * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
7527  * if PyArray_HASFIELDS(self):
7528  * PyObject_Free(info.format)
7529  */
7530 
7531 /* Python wrapper */
7532 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
7533 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
7534  __Pyx_RefNannyDeclarations
7535  __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
7536  __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
7537 
7538  /* function exit code */
7539  __Pyx_RefNannyFinishContext();
7540 }
7541 
7542 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
7543  __Pyx_RefNannyDeclarations
7544  int __pyx_t_1;
7545  __Pyx_RefNannySetupContext("__releasebuffer__", 0);
7546 
7547  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":295
7548  *
7549  * def __releasebuffer__(ndarray self, Py_buffer* info):
7550  * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
7551  * PyObject_Free(info.format)
7552  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
7553  */
7554  __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
7555  if (__pyx_t_1) {
7556 
7557  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":296
7558  * def __releasebuffer__(ndarray self, Py_buffer* info):
7559  * if PyArray_HASFIELDS(self):
7560  * PyObject_Free(info.format) # <<<<<<<<<<<<<<
7561  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
7562  * PyObject_Free(info.strides)
7563  */
7564  PyObject_Free(__pyx_v_info->format);
7565 
7566  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":295
7567  *
7568  * def __releasebuffer__(ndarray self, Py_buffer* info):
7569  * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
7570  * PyObject_Free(info.format)
7571  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
7572  */
7573  }
7574 
7575  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":297
7576  * if PyArray_HASFIELDS(self):
7577  * PyObject_Free(info.format)
7578  * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
7579  * PyObject_Free(info.strides)
7580  * # info.shape was stored after info.strides in the same block
7581  */
7582  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
7583  if (__pyx_t_1) {
7584 
7585  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":298
7586  * PyObject_Free(info.format)
7587  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
7588  * PyObject_Free(info.strides) # <<<<<<<<<<<<<<
7589  * # info.shape was stored after info.strides in the same block
7590  *
7591  */
7592  PyObject_Free(__pyx_v_info->strides);
7593 
7594  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":297
7595  * if PyArray_HASFIELDS(self):
7596  * PyObject_Free(info.format)
7597  * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
7598  * PyObject_Free(info.strides)
7599  * # info.shape was stored after info.strides in the same block
7600  */
7601  }
7602 
7603  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":294
7604  * f[0] = c'\0' # Terminate format string
7605  *
7606  * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
7607  * if PyArray_HASFIELDS(self):
7608  * PyObject_Free(info.format)
7609  */
7610 
7611  /* function exit code */
7612  __Pyx_RefNannyFinishContext();
7613 }
7614 
7615 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":775
7616  * ctypedef npy_cdouble complex_t
7617  *
7618  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
7619  * return PyArray_MultiIterNew(1, <void*>a)
7620  *
7621  */
7622 
7623 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
7624  PyObject *__pyx_r = NULL;
7625  __Pyx_RefNannyDeclarations
7626  PyObject *__pyx_t_1 = NULL;
7627  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
7628 
7629  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":776
7630  *
7631  * cdef inline object PyArray_MultiIterNew1(a):
7632  * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
7633  *
7634  * cdef inline object PyArray_MultiIterNew2(a, b):
7635  */
7636  __Pyx_XDECREF(__pyx_r);
7637  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 776, __pyx_L1_error)
7638  __Pyx_GOTREF(__pyx_t_1);
7639  __pyx_r = __pyx_t_1;
7640  __pyx_t_1 = 0;
7641  goto __pyx_L0;
7642 
7643  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":775
7644  * ctypedef npy_cdouble complex_t
7645  *
7646  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
7647  * return PyArray_MultiIterNew(1, <void*>a)
7648  *
7649  */
7650 
7651  /* function exit code */
7652  __pyx_L1_error:;
7653  __Pyx_XDECREF(__pyx_t_1);
7654  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
7655  __pyx_r = 0;
7656  __pyx_L0:;
7657  __Pyx_XGIVEREF(__pyx_r);
7658  __Pyx_RefNannyFinishContext();
7659  return __pyx_r;
7660 }
7661 
7662 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":778
7663  * return PyArray_MultiIterNew(1, <void*>a)
7664  *
7665  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
7666  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7667  *
7668  */
7669 
7670 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
7671  PyObject *__pyx_r = NULL;
7672  __Pyx_RefNannyDeclarations
7673  PyObject *__pyx_t_1 = NULL;
7674  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
7675 
7676  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":779
7677  *
7678  * cdef inline object PyArray_MultiIterNew2(a, b):
7679  * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
7680  *
7681  * cdef inline object PyArray_MultiIterNew3(a, b, c):
7682  */
7683  __Pyx_XDECREF(__pyx_r);
7684  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 779, __pyx_L1_error)
7685  __Pyx_GOTREF(__pyx_t_1);
7686  __pyx_r = __pyx_t_1;
7687  __pyx_t_1 = 0;
7688  goto __pyx_L0;
7689 
7690  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":778
7691  * return PyArray_MultiIterNew(1, <void*>a)
7692  *
7693  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
7694  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7695  *
7696  */
7697 
7698  /* function exit code */
7699  __pyx_L1_error:;
7700  __Pyx_XDECREF(__pyx_t_1);
7701  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
7702  __pyx_r = 0;
7703  __pyx_L0:;
7704  __Pyx_XGIVEREF(__pyx_r);
7705  __Pyx_RefNannyFinishContext();
7706  return __pyx_r;
7707 }
7708 
7709 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":781
7710  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7711  *
7712  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
7713  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7714  *
7715  */
7716 
7717 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
7718  PyObject *__pyx_r = NULL;
7719  __Pyx_RefNannyDeclarations
7720  PyObject *__pyx_t_1 = NULL;
7721  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
7722 
7723  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":782
7724  *
7725  * cdef inline object PyArray_MultiIterNew3(a, b, c):
7726  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
7727  *
7728  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
7729  */
7730  __Pyx_XDECREF(__pyx_r);
7731  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 782, __pyx_L1_error)
7732  __Pyx_GOTREF(__pyx_t_1);
7733  __pyx_r = __pyx_t_1;
7734  __pyx_t_1 = 0;
7735  goto __pyx_L0;
7736 
7737  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":781
7738  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7739  *
7740  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
7741  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7742  *
7743  */
7744 
7745  /* function exit code */
7746  __pyx_L1_error:;
7747  __Pyx_XDECREF(__pyx_t_1);
7748  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
7749  __pyx_r = 0;
7750  __pyx_L0:;
7751  __Pyx_XGIVEREF(__pyx_r);
7752  __Pyx_RefNannyFinishContext();
7753  return __pyx_r;
7754 }
7755 
7756 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":784
7757  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7758  *
7759  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
7760  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7761  *
7762  */
7763 
7764 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
7765  PyObject *__pyx_r = NULL;
7766  __Pyx_RefNannyDeclarations
7767  PyObject *__pyx_t_1 = NULL;
7768  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
7769 
7770  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":785
7771  *
7772  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
7773  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
7774  *
7775  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
7776  */
7777  __Pyx_XDECREF(__pyx_r);
7778  __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 785, __pyx_L1_error)
7779  __Pyx_GOTREF(__pyx_t_1);
7780  __pyx_r = __pyx_t_1;
7781  __pyx_t_1 = 0;
7782  goto __pyx_L0;
7783 
7784  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":784
7785  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7786  *
7787  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
7788  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7789  *
7790  */
7791 
7792  /* function exit code */
7793  __pyx_L1_error:;
7794  __Pyx_XDECREF(__pyx_t_1);
7795  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
7796  __pyx_r = 0;
7797  __pyx_L0:;
7798  __Pyx_XGIVEREF(__pyx_r);
7799  __Pyx_RefNannyFinishContext();
7800  return __pyx_r;
7801 }
7802 
7803 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":787
7804  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7805  *
7806  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
7807  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7808  *
7809  */
7810 
7811 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
7812  PyObject *__pyx_r = NULL;
7813  __Pyx_RefNannyDeclarations
7814  PyObject *__pyx_t_1 = NULL;
7815  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
7816 
7817  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":788
7818  *
7819  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
7820  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
7821  *
7822  * cdef inline tuple PyDataType_SHAPE(dtype d):
7823  */
7824  __Pyx_XDECREF(__pyx_r);
7825  __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 788, __pyx_L1_error)
7826  __Pyx_GOTREF(__pyx_t_1);
7827  __pyx_r = __pyx_t_1;
7828  __pyx_t_1 = 0;
7829  goto __pyx_L0;
7830 
7831  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":787
7832  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7833  *
7834  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
7835  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7836  *
7837  */
7838 
7839  /* function exit code */
7840  __pyx_L1_error:;
7841  __Pyx_XDECREF(__pyx_t_1);
7842  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
7843  __pyx_r = 0;
7844  __pyx_L0:;
7845  __Pyx_XGIVEREF(__pyx_r);
7846  __Pyx_RefNannyFinishContext();
7847  return __pyx_r;
7848 }
7849 
7850 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":790
7851  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7852  *
7853  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
7854  * if PyDataType_HASSUBARRAY(d):
7855  * return <tuple>d.subarray.shape
7856  */
7857 
7858 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
7859  PyObject *__pyx_r = NULL;
7860  __Pyx_RefNannyDeclarations
7861  int __pyx_t_1;
7862  __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
7863 
7864  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":791
7865  *
7866  * cdef inline tuple PyDataType_SHAPE(dtype d):
7867  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
7868  * return <tuple>d.subarray.shape
7869  * else:
7870  */
7871  __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
7872  if (__pyx_t_1) {
7873 
7874  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":792
7875  * cdef inline tuple PyDataType_SHAPE(dtype d):
7876  * if PyDataType_HASSUBARRAY(d):
7877  * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
7878  * else:
7879  * return ()
7880  */
7881  __Pyx_XDECREF(__pyx_r);
7882  __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
7883  __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
7884  goto __pyx_L0;
7885 
7886  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":791
7887  *
7888  * cdef inline tuple PyDataType_SHAPE(dtype d):
7889  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
7890  * return <tuple>d.subarray.shape
7891  * else:
7892  */
7893  }
7894 
7895  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794
7896  * return <tuple>d.subarray.shape
7897  * else:
7898  * return () # <<<<<<<<<<<<<<
7899  *
7900  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
7901  */
7902  /*else*/ {
7903  __Pyx_XDECREF(__pyx_r);
7904  __Pyx_INCREF(__pyx_empty_tuple);
7905  __pyx_r = __pyx_empty_tuple;
7906  goto __pyx_L0;
7907  }
7908 
7909  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":790
7910  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7911  *
7912  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
7913  * if PyDataType_HASSUBARRAY(d):
7914  * return <tuple>d.subarray.shape
7915  */
7916 
7917  /* function exit code */
7918  __pyx_L0:;
7919  __Pyx_XGIVEREF(__pyx_r);
7920  __Pyx_RefNannyFinishContext();
7921  return __pyx_r;
7922 }
7923 
7924 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":796
7925  * return ()
7926  *
7927  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
7928  * # Recursive utility function used in __getbuffer__ to get format
7929  * # string. The new location in the format string is returned.
7930  */
7931 
7932 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) {
7933  PyArray_Descr *__pyx_v_child = 0;
7934  int __pyx_v_endian_detector;
7935  int __pyx_v_little_endian;
7936  PyObject *__pyx_v_fields = 0;
7937  PyObject *__pyx_v_childname = NULL;
7938  PyObject *__pyx_v_new_offset = NULL;
7939  PyObject *__pyx_v_t = NULL;
7940  char *__pyx_r;
7941  __Pyx_RefNannyDeclarations
7942  PyObject *__pyx_t_1 = NULL;
7943  Py_ssize_t __pyx_t_2;
7944  PyObject *__pyx_t_3 = NULL;
7945  PyObject *__pyx_t_4 = NULL;
7946  int __pyx_t_5;
7947  int __pyx_t_6;
7948  int __pyx_t_7;
7949  long __pyx_t_8;
7950  char *__pyx_t_9;
7951  __Pyx_RefNannySetupContext("_util_dtypestring", 0);
7952 
7953  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801
7954  *
7955  * cdef dtype child
7956  * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
7957  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
7958  * cdef tuple fields
7959  */
7960  __pyx_v_endian_detector = 1;
7961 
7962  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":802
7963  * cdef dtype child
7964  * cdef int endian_detector = 1
7965  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
7966  * cdef tuple fields
7967  *
7968  */
7969  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
7970 
7971  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":805
7972  * cdef tuple fields
7973  *
7974  * for childname in descr.names: # <<<<<<<<<<<<<<
7975  * fields = descr.fields[childname]
7976  * child, new_offset = fields
7977  */
7978  if (unlikely(__pyx_v_descr->names == Py_None)) {
7979  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
7980  __PYX_ERR(2, 805, __pyx_L1_error)
7981  }
7982  __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
7983  for (;;) {
7984  if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
7985  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7986  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(2, 805, __pyx_L1_error)
7987  #else
7988  __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 805, __pyx_L1_error)
7989  __Pyx_GOTREF(__pyx_t_3);
7990  #endif
7991  __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
7992  __pyx_t_3 = 0;
7993 
7994  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":806
7995  *
7996  * for childname in descr.names:
7997  * fields = descr.fields[childname] # <<<<<<<<<<<<<<
7998  * child, new_offset = fields
7999  *
8000  */
8001  if (unlikely(__pyx_v_descr->fields == Py_None)) {
8002  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
8003  __PYX_ERR(2, 806, __pyx_L1_error)
8004  }
8005  __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 806, __pyx_L1_error)
8006  __Pyx_GOTREF(__pyx_t_3);
8007  if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(2, 806, __pyx_L1_error)
8008  __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
8009  __pyx_t_3 = 0;
8010 
8011  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":807
8012  * for childname in descr.names:
8013  * fields = descr.fields[childname]
8014  * child, new_offset = fields # <<<<<<<<<<<<<<
8015  *
8016  * if (end - f) - <int>(new_offset - offset[0]) < 15:
8017  */
8018  if (likely(__pyx_v_fields != Py_None)) {
8019  PyObject* sequence = __pyx_v_fields;
8020  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
8021  if (unlikely(size != 2)) {
8022  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
8023  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
8024  __PYX_ERR(2, 807, __pyx_L1_error)
8025  }
8026  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8027  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
8028  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
8029  __Pyx_INCREF(__pyx_t_3);
8030  __Pyx_INCREF(__pyx_t_4);
8031  #else
8032  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 807, __pyx_L1_error)
8033  __Pyx_GOTREF(__pyx_t_3);
8034  __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 807, __pyx_L1_error)
8035  __Pyx_GOTREF(__pyx_t_4);
8036  #endif
8037  } else {
8038  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 807, __pyx_L1_error)
8039  }
8040  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(2, 807, __pyx_L1_error)
8041  __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
8042  __pyx_t_3 = 0;
8043  __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
8044  __pyx_t_4 = 0;
8045 
8046  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":809
8047  * child, new_offset = fields
8048  *
8049  * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
8050  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
8051  *
8052  */
8053  __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 809, __pyx_L1_error)
8054  __Pyx_GOTREF(__pyx_t_4);
8055  __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 809, __pyx_L1_error)
8056  __Pyx_GOTREF(__pyx_t_3);
8057  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8058  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 809, __pyx_L1_error)
8059  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8060  __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
8061  if (unlikely(__pyx_t_6)) {
8062 
8063  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":810
8064  *
8065  * if (end - f) - <int>(new_offset - offset[0]) < 15:
8066  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
8067  *
8068  * if ((child.byteorder == c'>' and little_endian) or
8069  */
8070  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 810, __pyx_L1_error)
8071  __Pyx_GOTREF(__pyx_t_3);
8072  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8073  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8074  __PYX_ERR(2, 810, __pyx_L1_error)
8075 
8076  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":809
8077  * child, new_offset = fields
8078  *
8079  * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
8080  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
8081  *
8082  */
8083  }
8084 
8085  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":812
8086  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
8087  *
8088  * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
8089  * (child.byteorder == c'<' and not little_endian)):
8090  * raise ValueError(u"Non-native byte order not supported")
8091  */
8092  __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
8093  if (!__pyx_t_7) {
8094  goto __pyx_L8_next_or;
8095  } else {
8096  }
8097  __pyx_t_7 = (__pyx_v_little_endian != 0);
8098  if (!__pyx_t_7) {
8099  } else {
8100  __pyx_t_6 = __pyx_t_7;
8101  goto __pyx_L7_bool_binop_done;
8102  }
8103  __pyx_L8_next_or:;
8104 
8105  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":813
8106  *
8107  * if ((child.byteorder == c'>' and little_endian) or
8108  * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
8109  * raise ValueError(u"Non-native byte order not supported")
8110  * # One could encode it in the format string and have Cython
8111  */
8112  __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
8113  if (__pyx_t_7) {
8114  } else {
8115  __pyx_t_6 = __pyx_t_7;
8116  goto __pyx_L7_bool_binop_done;
8117  }
8118  __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
8119  __pyx_t_6 = __pyx_t_7;
8120  __pyx_L7_bool_binop_done:;
8121 
8122  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":812
8123  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
8124  *
8125  * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
8126  * (child.byteorder == c'<' and not little_endian)):
8127  * raise ValueError(u"Non-native byte order not supported")
8128  */
8129  if (unlikely(__pyx_t_6)) {
8130 
8131  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":814
8132  * if ((child.byteorder == c'>' and little_endian) or
8133  * (child.byteorder == c'<' and not little_endian)):
8134  * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
8135  * # One could encode it in the format string and have Cython
8136  * # complain instead, BUT: < and > in format strings also imply
8137  */
8138  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 814, __pyx_L1_error)
8139  __Pyx_GOTREF(__pyx_t_3);
8140  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8141  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8142  __PYX_ERR(2, 814, __pyx_L1_error)
8143 
8144  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":812
8145  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
8146  *
8147  * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
8148  * (child.byteorder == c'<' and not little_endian)):
8149  * raise ValueError(u"Non-native byte order not supported")
8150  */
8151  }
8152 
8153  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":824
8154  *
8155  * # Output padding bytes
8156  * while offset[0] < new_offset: # <<<<<<<<<<<<<<
8157  * f[0] = 120 # "x"; pad byte
8158  * f += 1
8159  */
8160  while (1) {
8161  __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 824, __pyx_L1_error)
8162  __Pyx_GOTREF(__pyx_t_3);
8163  __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 824, __pyx_L1_error)
8164  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8165  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 824, __pyx_L1_error)
8166  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8167  if (!__pyx_t_6) break;
8168 
8169  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":825
8170  * # Output padding bytes
8171  * while offset[0] < new_offset:
8172  * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<<
8173  * f += 1
8174  * offset[0] += 1
8175  */
8176  (__pyx_v_f[0]) = 0x78;
8177 
8178  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":826
8179  * while offset[0] < new_offset:
8180  * f[0] = 120 # "x"; pad byte
8181  * f += 1 # <<<<<<<<<<<<<<
8182  * offset[0] += 1
8183  *
8184  */
8185  __pyx_v_f = (__pyx_v_f + 1);
8186 
8187  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":827
8188  * f[0] = 120 # "x"; pad byte
8189  * f += 1
8190  * offset[0] += 1 # <<<<<<<<<<<<<<
8191  *
8192  * offset[0] += child.itemsize
8193  */
8194  __pyx_t_8 = 0;
8195  (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
8196  }
8197 
8198  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":829
8199  * offset[0] += 1
8200  *
8201  * offset[0] += child.itemsize # <<<<<<<<<<<<<<
8202  *
8203  * if not PyDataType_HASFIELDS(child):
8204  */
8205  __pyx_t_8 = 0;
8206  (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
8207 
8208  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":831
8209  * offset[0] += child.itemsize
8210  *
8211  * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
8212  * t = child.type_num
8213  * if end - f < 5:
8214  */
8215  __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
8216  if (__pyx_t_6) {
8217 
8218  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":832
8219  *
8220  * if not PyDataType_HASFIELDS(child):
8221  * t = child.type_num # <<<<<<<<<<<<<<
8222  * if end - f < 5:
8223  * raise RuntimeError(u"Format string allocated too short.")
8224  */
8225  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 832, __pyx_L1_error)
8226  __Pyx_GOTREF(__pyx_t_4);
8227  __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
8228  __pyx_t_4 = 0;
8229 
8230  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":833
8231  * if not PyDataType_HASFIELDS(child):
8232  * t = child.type_num
8233  * if end - f < 5: # <<<<<<<<<<<<<<
8234  * raise RuntimeError(u"Format string allocated too short.")
8235  *
8236  */
8237  __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
8238  if (unlikely(__pyx_t_6)) {
8239 
8240  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":834
8241  * t = child.type_num
8242  * if end - f < 5:
8243  * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
8244  *
8245  * # Until ticket #99 is fixed, use integers to avoid warnings
8246  */
8247  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 834, __pyx_L1_error)
8248  __Pyx_GOTREF(__pyx_t_4);
8249  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
8250  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8251  __PYX_ERR(2, 834, __pyx_L1_error)
8252 
8253  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":833
8254  * if not PyDataType_HASFIELDS(child):
8255  * t = child.type_num
8256  * if end - f < 5: # <<<<<<<<<<<<<<
8257  * raise RuntimeError(u"Format string allocated too short.")
8258  *
8259  */
8260  }
8261 
8262  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":837
8263  *
8264  * # Until ticket #99 is fixed, use integers to avoid warnings
8265  * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<<
8266  * elif t == NPY_UBYTE: f[0] = 66 #"B"
8267  * elif t == NPY_SHORT: f[0] = 104 #"h"
8268  */
8269  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 837, __pyx_L1_error)
8270  __Pyx_GOTREF(__pyx_t_4);
8271  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 837, __pyx_L1_error)
8272  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8273  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 837, __pyx_L1_error)
8274  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8275  if (__pyx_t_6) {
8276  (__pyx_v_f[0]) = 98;
8277  goto __pyx_L15;
8278  }
8279 
8280  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":838
8281  * # Until ticket #99 is fixed, use integers to avoid warnings
8282  * if t == NPY_BYTE: f[0] = 98 #"b"
8283  * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<<
8284  * elif t == NPY_SHORT: f[0] = 104 #"h"
8285  * elif t == NPY_USHORT: f[0] = 72 #"H"
8286  */
8287  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 838, __pyx_L1_error)
8288  __Pyx_GOTREF(__pyx_t_3);
8289  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 838, __pyx_L1_error)
8290  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8291  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 838, __pyx_L1_error)
8292  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8293  if (__pyx_t_6) {
8294  (__pyx_v_f[0]) = 66;
8295  goto __pyx_L15;
8296  }
8297 
8298  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":839
8299  * if t == NPY_BYTE: f[0] = 98 #"b"
8300  * elif t == NPY_UBYTE: f[0] = 66 #"B"
8301  * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<<
8302  * elif t == NPY_USHORT: f[0] = 72 #"H"
8303  * elif t == NPY_INT: f[0] = 105 #"i"
8304  */
8305  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 839, __pyx_L1_error)
8306  __Pyx_GOTREF(__pyx_t_4);
8307  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 839, __pyx_L1_error)
8308  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8309  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 839, __pyx_L1_error)
8310  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8311  if (__pyx_t_6) {
8312  (__pyx_v_f[0]) = 0x68;
8313  goto __pyx_L15;
8314  }
8315 
8316  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":840
8317  * elif t == NPY_UBYTE: f[0] = 66 #"B"
8318  * elif t == NPY_SHORT: f[0] = 104 #"h"
8319  * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<<
8320  * elif t == NPY_INT: f[0] = 105 #"i"
8321  * elif t == NPY_UINT: f[0] = 73 #"I"
8322  */
8323  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 840, __pyx_L1_error)
8324  __Pyx_GOTREF(__pyx_t_3);
8325  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 840, __pyx_L1_error)
8326  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8327  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 840, __pyx_L1_error)
8328  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8329  if (__pyx_t_6) {
8330  (__pyx_v_f[0]) = 72;
8331  goto __pyx_L15;
8332  }
8333 
8334  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":841
8335  * elif t == NPY_SHORT: f[0] = 104 #"h"
8336  * elif t == NPY_USHORT: f[0] = 72 #"H"
8337  * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<<
8338  * elif t == NPY_UINT: f[0] = 73 #"I"
8339  * elif t == NPY_LONG: f[0] = 108 #"l"
8340  */
8341  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 841, __pyx_L1_error)
8342  __Pyx_GOTREF(__pyx_t_4);
8343  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 841, __pyx_L1_error)
8344  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8345  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 841, __pyx_L1_error)
8346  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8347  if (__pyx_t_6) {
8348  (__pyx_v_f[0]) = 0x69;
8349  goto __pyx_L15;
8350  }
8351 
8352  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":842
8353  * elif t == NPY_USHORT: f[0] = 72 #"H"
8354  * elif t == NPY_INT: f[0] = 105 #"i"
8355  * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<<
8356  * elif t == NPY_LONG: f[0] = 108 #"l"
8357  * elif t == NPY_ULONG: f[0] = 76 #"L"
8358  */
8359  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 842, __pyx_L1_error)
8360  __Pyx_GOTREF(__pyx_t_3);
8361  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 842, __pyx_L1_error)
8362  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8363  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 842, __pyx_L1_error)
8364  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8365  if (__pyx_t_6) {
8366  (__pyx_v_f[0]) = 73;
8367  goto __pyx_L15;
8368  }
8369 
8370  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":843
8371  * elif t == NPY_INT: f[0] = 105 #"i"
8372  * elif t == NPY_UINT: f[0] = 73 #"I"
8373  * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<<
8374  * elif t == NPY_ULONG: f[0] = 76 #"L"
8375  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
8376  */
8377  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 843, __pyx_L1_error)
8378  __Pyx_GOTREF(__pyx_t_4);
8379  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 843, __pyx_L1_error)
8380  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8381  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 843, __pyx_L1_error)
8382  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8383  if (__pyx_t_6) {
8384  (__pyx_v_f[0]) = 0x6C;
8385  goto __pyx_L15;
8386  }
8387 
8388  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":844
8389  * elif t == NPY_UINT: f[0] = 73 #"I"
8390  * elif t == NPY_LONG: f[0] = 108 #"l"
8391  * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<<
8392  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
8393  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
8394  */
8395  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 844, __pyx_L1_error)
8396  __Pyx_GOTREF(__pyx_t_3);
8397  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 844, __pyx_L1_error)
8398  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8399  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 844, __pyx_L1_error)
8400  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8401  if (__pyx_t_6) {
8402  (__pyx_v_f[0]) = 76;
8403  goto __pyx_L15;
8404  }
8405 
8406  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":845
8407  * elif t == NPY_LONG: f[0] = 108 #"l"
8408  * elif t == NPY_ULONG: f[0] = 76 #"L"
8409  * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<<
8410  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
8411  * elif t == NPY_FLOAT: f[0] = 102 #"f"
8412  */
8413  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 845, __pyx_L1_error)
8414  __Pyx_GOTREF(__pyx_t_4);
8415  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 845, __pyx_L1_error)
8416  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8417  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 845, __pyx_L1_error)
8418  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8419  if (__pyx_t_6) {
8420  (__pyx_v_f[0]) = 0x71;
8421  goto __pyx_L15;
8422  }
8423 
8424  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":846
8425  * elif t == NPY_ULONG: f[0] = 76 #"L"
8426  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
8427  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<<
8428  * elif t == NPY_FLOAT: f[0] = 102 #"f"
8429  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
8430  */
8431  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 846, __pyx_L1_error)
8432  __Pyx_GOTREF(__pyx_t_3);
8433  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 846, __pyx_L1_error)
8434  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8435  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 846, __pyx_L1_error)
8436  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8437  if (__pyx_t_6) {
8438  (__pyx_v_f[0]) = 81;
8439  goto __pyx_L15;
8440  }
8441 
8442  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":847
8443  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
8444  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
8445  * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<<
8446  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
8447  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
8448  */
8449  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 847, __pyx_L1_error)
8450  __Pyx_GOTREF(__pyx_t_4);
8451  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 847, __pyx_L1_error)
8452  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8453  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 847, __pyx_L1_error)
8454  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8455  if (__pyx_t_6) {
8456  (__pyx_v_f[0]) = 0x66;
8457  goto __pyx_L15;
8458  }
8459 
8460  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":848
8461  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
8462  * elif t == NPY_FLOAT: f[0] = 102 #"f"
8463  * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<<
8464  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
8465  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
8466  */
8467  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 848, __pyx_L1_error)
8468  __Pyx_GOTREF(__pyx_t_3);
8469  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 848, __pyx_L1_error)
8470  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8471  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 848, __pyx_L1_error)
8472  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8473  if (__pyx_t_6) {
8474  (__pyx_v_f[0]) = 0x64;
8475  goto __pyx_L15;
8476  }
8477 
8478  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":849
8479  * elif t == NPY_FLOAT: f[0] = 102 #"f"
8480  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
8481  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<<
8482  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
8483  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
8484  */
8485  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 849, __pyx_L1_error)
8486  __Pyx_GOTREF(__pyx_t_4);
8487  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 849, __pyx_L1_error)
8488  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8489  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 849, __pyx_L1_error)
8490  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8491  if (__pyx_t_6) {
8492  (__pyx_v_f[0]) = 0x67;
8493  goto __pyx_L15;
8494  }
8495 
8496  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":850
8497  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
8498  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
8499  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<<
8500  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
8501  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
8502  */
8503  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 850, __pyx_L1_error)
8504  __Pyx_GOTREF(__pyx_t_3);
8505  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 850, __pyx_L1_error)
8506  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8507  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 850, __pyx_L1_error)
8508  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8509  if (__pyx_t_6) {
8510  (__pyx_v_f[0]) = 90;
8511  (__pyx_v_f[1]) = 0x66;
8512  __pyx_v_f = (__pyx_v_f + 1);
8513  goto __pyx_L15;
8514  }
8515 
8516  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":851
8517  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
8518  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
8519  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<<
8520  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
8521  * elif t == NPY_OBJECT: f[0] = 79 #"O"
8522  */
8523  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 851, __pyx_L1_error)
8524  __Pyx_GOTREF(__pyx_t_4);
8525  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 851, __pyx_L1_error)
8526  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8527  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 851, __pyx_L1_error)
8528  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8529  if (__pyx_t_6) {
8530  (__pyx_v_f[0]) = 90;
8531  (__pyx_v_f[1]) = 0x64;
8532  __pyx_v_f = (__pyx_v_f + 1);
8533  goto __pyx_L15;
8534  }
8535 
8536  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":852
8537  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
8538  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
8539  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<<
8540  * elif t == NPY_OBJECT: f[0] = 79 #"O"
8541  * else:
8542  */
8543  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 852, __pyx_L1_error)
8544  __Pyx_GOTREF(__pyx_t_3);
8545  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 852, __pyx_L1_error)
8546  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8547  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 852, __pyx_L1_error)
8548  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8549  if (__pyx_t_6) {
8550  (__pyx_v_f[0]) = 90;
8551  (__pyx_v_f[1]) = 0x67;
8552  __pyx_v_f = (__pyx_v_f + 1);
8553  goto __pyx_L15;
8554  }
8555 
8556  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":853
8557  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
8558  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
8559  * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<<
8560  * else:
8561  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
8562  */
8563  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 853, __pyx_L1_error)
8564  __Pyx_GOTREF(__pyx_t_4);
8565  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 853, __pyx_L1_error)
8566  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8567  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 853, __pyx_L1_error)
8568  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8569  if (likely(__pyx_t_6)) {
8570  (__pyx_v_f[0]) = 79;
8571  goto __pyx_L15;
8572  }
8573 
8574  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":855
8575  * elif t == NPY_OBJECT: f[0] = 79 #"O"
8576  * else:
8577  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
8578  * f += 1
8579  * else:
8580  */
8581  /*else*/ {
8582  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 855, __pyx_L1_error)
8583  __Pyx_GOTREF(__pyx_t_3);
8584  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 855, __pyx_L1_error)
8585  __Pyx_GOTREF(__pyx_t_4);
8586  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8587  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
8588  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8589  __PYX_ERR(2, 855, __pyx_L1_error)
8590  }
8591  __pyx_L15:;
8592 
8593  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":856
8594  * else:
8595  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
8596  * f += 1 # <<<<<<<<<<<<<<
8597  * else:
8598  * # Cython ignores struct boundary information ("T{...}"),
8599  */
8600  __pyx_v_f = (__pyx_v_f + 1);
8601 
8602  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":831
8603  * offset[0] += child.itemsize
8604  *
8605  * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
8606  * t = child.type_num
8607  * if end - f < 5:
8608  */
8609  goto __pyx_L13;
8610  }
8611 
8612  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":860
8613  * # Cython ignores struct boundary information ("T{...}"),
8614  * # so don't output it
8615  * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<<
8616  * return f
8617  *
8618  */
8619  /*else*/ {
8620  __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(2, 860, __pyx_L1_error)
8621  __pyx_v_f = __pyx_t_9;
8622  }
8623  __pyx_L13:;
8624 
8625  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":805
8626  * cdef tuple fields
8627  *
8628  * for childname in descr.names: # <<<<<<<<<<<<<<
8629  * fields = descr.fields[childname]
8630  * child, new_offset = fields
8631  */
8632  }
8633  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8634 
8635  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":861
8636  * # so don't output it
8637  * f = _util_dtypestring(child, f, end, offset)
8638  * return f # <<<<<<<<<<<<<<
8639  *
8640  *
8641  */
8642  __pyx_r = __pyx_v_f;
8643  goto __pyx_L0;
8644 
8645  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":796
8646  * return ()
8647  *
8648  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
8649  * # Recursive utility function used in __getbuffer__ to get format
8650  * # string. The new location in the format string is returned.
8651  */
8652 
8653  /* function exit code */
8654  __pyx_L1_error:;
8655  __Pyx_XDECREF(__pyx_t_1);
8656  __Pyx_XDECREF(__pyx_t_3);
8657  __Pyx_XDECREF(__pyx_t_4);
8658  __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
8659  __pyx_r = NULL;
8660  __pyx_L0:;
8661  __Pyx_XDECREF((PyObject *)__pyx_v_child);
8662  __Pyx_XDECREF(__pyx_v_fields);
8663  __Pyx_XDECREF(__pyx_v_childname);
8664  __Pyx_XDECREF(__pyx_v_new_offset);
8665  __Pyx_XDECREF(__pyx_v_t);
8666  __Pyx_RefNannyFinishContext();
8667  return __pyx_r;
8668 }
8669 
8670 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":977
8671  *
8672  *
8673  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
8674  * cdef PyObject* baseptr
8675  * if base is None:
8676  */
8677 
8678 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
8679  PyObject *__pyx_v_baseptr;
8680  __Pyx_RefNannyDeclarations
8681  int __pyx_t_1;
8682  int __pyx_t_2;
8683  __Pyx_RefNannySetupContext("set_array_base", 0);
8684 
8685  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":979
8686  * cdef inline void set_array_base(ndarray arr, object base):
8687  * cdef PyObject* baseptr
8688  * if base is None: # <<<<<<<<<<<<<<
8689  * baseptr = NULL
8690  * else:
8691  */
8692  __pyx_t_1 = (__pyx_v_base == Py_None);
8693  __pyx_t_2 = (__pyx_t_1 != 0);
8694  if (__pyx_t_2) {
8695 
8696  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":980
8697  * cdef PyObject* baseptr
8698  * if base is None:
8699  * baseptr = NULL # <<<<<<<<<<<<<<
8700  * else:
8701  * Py_INCREF(base) # important to do this before decref below!
8702  */
8703  __pyx_v_baseptr = NULL;
8704 
8705  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":979
8706  * cdef inline void set_array_base(ndarray arr, object base):
8707  * cdef PyObject* baseptr
8708  * if base is None: # <<<<<<<<<<<<<<
8709  * baseptr = NULL
8710  * else:
8711  */
8712  goto __pyx_L3;
8713  }
8714 
8715  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":982
8716  * baseptr = NULL
8717  * else:
8718  * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<<
8719  * baseptr = <PyObject*>base
8720  * Py_XDECREF(arr.base)
8721  */
8722  /*else*/ {
8723  Py_INCREF(__pyx_v_base);
8724 
8725  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":983
8726  * else:
8727  * Py_INCREF(base) # important to do this before decref below!
8728  * baseptr = <PyObject*>base # <<<<<<<<<<<<<<
8729  * Py_XDECREF(arr.base)
8730  * arr.base = baseptr
8731  */
8732  __pyx_v_baseptr = ((PyObject *)__pyx_v_base);
8733  }
8734  __pyx_L3:;
8735 
8736  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":984
8737  * Py_INCREF(base) # important to do this before decref below!
8738  * baseptr = <PyObject*>base
8739  * Py_XDECREF(arr.base) # <<<<<<<<<<<<<<
8740  * arr.base = baseptr
8741  *
8742  */
8743  Py_XDECREF(__pyx_v_arr->base);
8744 
8745  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":985
8746  * baseptr = <PyObject*>base
8747  * Py_XDECREF(arr.base)
8748  * arr.base = baseptr # <<<<<<<<<<<<<<
8749  *
8750  * cdef inline object get_array_base(ndarray arr):
8751  */
8752  __pyx_v_arr->base = __pyx_v_baseptr;
8753 
8754  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":977
8755  *
8756  *
8757  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
8758  * cdef PyObject* baseptr
8759  * if base is None:
8760  */
8761 
8762  /* function exit code */
8763  __Pyx_RefNannyFinishContext();
8764 }
8765 
8766 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":987
8767  * arr.base = baseptr
8768  *
8769  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
8770  * if arr.base is NULL:
8771  * return None
8772  */
8773 
8774 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
8775  PyObject *__pyx_r = NULL;
8776  __Pyx_RefNannyDeclarations
8777  int __pyx_t_1;
8778  __Pyx_RefNannySetupContext("get_array_base", 0);
8779 
8780  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":988
8781  *
8782  * cdef inline object get_array_base(ndarray arr):
8783  * if arr.base is NULL: # <<<<<<<<<<<<<<
8784  * return None
8785  * else:
8786  */
8787  __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0);
8788  if (__pyx_t_1) {
8789 
8790  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":989
8791  * cdef inline object get_array_base(ndarray arr):
8792  * if arr.base is NULL:
8793  * return None # <<<<<<<<<<<<<<
8794  * else:
8795  * return <object>arr.base
8796  */
8797  __Pyx_XDECREF(__pyx_r);
8798  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8799  goto __pyx_L0;
8800 
8801  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":988
8802  *
8803  * cdef inline object get_array_base(ndarray arr):
8804  * if arr.base is NULL: # <<<<<<<<<<<<<<
8805  * return None
8806  * else:
8807  */
8808  }
8809 
8810  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":991
8811  * return None
8812  * else:
8813  * return <object>arr.base # <<<<<<<<<<<<<<
8814  *
8815  *
8816  */
8817  /*else*/ {
8818  __Pyx_XDECREF(__pyx_r);
8819  __Pyx_INCREF(((PyObject *)__pyx_v_arr->base));
8820  __pyx_r = ((PyObject *)__pyx_v_arr->base);
8821  goto __pyx_L0;
8822  }
8823 
8824  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":987
8825  * arr.base = baseptr
8826  *
8827  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
8828  * if arr.base is NULL:
8829  * return None
8830  */
8831 
8832  /* function exit code */
8833  __pyx_L0:;
8834  __Pyx_XGIVEREF(__pyx_r);
8835  __Pyx_RefNannyFinishContext();
8836  return __pyx_r;
8837 }
8838 
8839 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":996
8840  * # Versions of the import_* functions which are more suitable for
8841  * # Cython code.
8842  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
8843  * try:
8844  * _import_array()
8845  */
8846 
8847 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
8848  int __pyx_r;
8849  __Pyx_RefNannyDeclarations
8850  PyObject *__pyx_t_1 = NULL;
8851  PyObject *__pyx_t_2 = NULL;
8852  PyObject *__pyx_t_3 = NULL;
8853  int __pyx_t_4;
8854  PyObject *__pyx_t_5 = NULL;
8855  PyObject *__pyx_t_6 = NULL;
8856  PyObject *__pyx_t_7 = NULL;
8857  PyObject *__pyx_t_8 = NULL;
8858  __Pyx_RefNannySetupContext("import_array", 0);
8859 
8860  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":997
8861  * # Cython code.
8862  * cdef inline int import_array() except -1:
8863  * try: # <<<<<<<<<<<<<<
8864  * _import_array()
8865  * except Exception:
8866  */
8867  {
8868  __Pyx_PyThreadState_declare
8869  __Pyx_PyThreadState_assign
8870  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
8871  __Pyx_XGOTREF(__pyx_t_1);
8872  __Pyx_XGOTREF(__pyx_t_2);
8873  __Pyx_XGOTREF(__pyx_t_3);
8874  /*try:*/ {
8875 
8876  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":998
8877  * cdef inline int import_array() except -1:
8878  * try:
8879  * _import_array() # <<<<<<<<<<<<<<
8880  * except Exception:
8881  * raise ImportError("numpy.core.multiarray failed to import")
8882  */
8883  __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 998, __pyx_L3_error)
8884 
8885  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":997
8886  * # Cython code.
8887  * cdef inline int import_array() except -1:
8888  * try: # <<<<<<<<<<<<<<
8889  * _import_array()
8890  * except Exception:
8891  */
8892  }
8893  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8894  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8895  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8896  goto __pyx_L8_try_end;
8897  __pyx_L3_error:;
8898 
8899  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":999
8900  * try:
8901  * _import_array()
8902  * except Exception: # <<<<<<<<<<<<<<
8903  * raise ImportError("numpy.core.multiarray failed to import")
8904  *
8905  */
8906  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
8907  if (__pyx_t_4) {
8908  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
8909  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 999, __pyx_L5_except_error)
8910  __Pyx_GOTREF(__pyx_t_5);
8911  __Pyx_GOTREF(__pyx_t_6);
8912  __Pyx_GOTREF(__pyx_t_7);
8913 
8914  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1000
8915  * _import_array()
8916  * except Exception:
8917  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
8918  *
8919  * cdef inline int import_umath() except -1:
8920  */
8921  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1000, __pyx_L5_except_error)
8922  __Pyx_GOTREF(__pyx_t_8);
8923  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
8924  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8925  __PYX_ERR(2, 1000, __pyx_L5_except_error)
8926  }
8927  goto __pyx_L5_except_error;
8928  __pyx_L5_except_error:;
8929 
8930  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":997
8931  * # Cython code.
8932  * cdef inline int import_array() except -1:
8933  * try: # <<<<<<<<<<<<<<
8934  * _import_array()
8935  * except Exception:
8936  */
8937  __Pyx_XGIVEREF(__pyx_t_1);
8938  __Pyx_XGIVEREF(__pyx_t_2);
8939  __Pyx_XGIVEREF(__pyx_t_3);
8940  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8941  goto __pyx_L1_error;
8942  __pyx_L8_try_end:;
8943  }
8944 
8945  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":996
8946  * # Versions of the import_* functions which are more suitable for
8947  * # Cython code.
8948  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
8949  * try:
8950  * _import_array()
8951  */
8952 
8953  /* function exit code */
8954  __pyx_r = 0;
8955  goto __pyx_L0;
8956  __pyx_L1_error:;
8957  __Pyx_XDECREF(__pyx_t_5);
8958  __Pyx_XDECREF(__pyx_t_6);
8959  __Pyx_XDECREF(__pyx_t_7);
8960  __Pyx_XDECREF(__pyx_t_8);
8961  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
8962  __pyx_r = -1;
8963  __pyx_L0:;
8964  __Pyx_RefNannyFinishContext();
8965  return __pyx_r;
8966 }
8967 
8968 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1002
8969  * raise ImportError("numpy.core.multiarray failed to import")
8970  *
8971  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
8972  * try:
8973  * _import_umath()
8974  */
8975 
8976 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
8977  int __pyx_r;
8978  __Pyx_RefNannyDeclarations
8979  PyObject *__pyx_t_1 = NULL;
8980  PyObject *__pyx_t_2 = NULL;
8981  PyObject *__pyx_t_3 = NULL;
8982  int __pyx_t_4;
8983  PyObject *__pyx_t_5 = NULL;
8984  PyObject *__pyx_t_6 = NULL;
8985  PyObject *__pyx_t_7 = NULL;
8986  PyObject *__pyx_t_8 = NULL;
8987  __Pyx_RefNannySetupContext("import_umath", 0);
8988 
8989  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1003
8990  *
8991  * cdef inline int import_umath() except -1:
8992  * try: # <<<<<<<<<<<<<<
8993  * _import_umath()
8994  * except Exception:
8995  */
8996  {
8997  __Pyx_PyThreadState_declare
8998  __Pyx_PyThreadState_assign
8999  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
9000  __Pyx_XGOTREF(__pyx_t_1);
9001  __Pyx_XGOTREF(__pyx_t_2);
9002  __Pyx_XGOTREF(__pyx_t_3);
9003  /*try:*/ {
9004 
9005  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1004
9006  * cdef inline int import_umath() except -1:
9007  * try:
9008  * _import_umath() # <<<<<<<<<<<<<<
9009  * except Exception:
9010  * raise ImportError("numpy.core.umath failed to import")
9011  */
9012  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1004, __pyx_L3_error)
9013 
9014  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1003
9015  *
9016  * cdef inline int import_umath() except -1:
9017  * try: # <<<<<<<<<<<<<<
9018  * _import_umath()
9019  * except Exception:
9020  */
9021  }
9022  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
9023  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
9024  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9025  goto __pyx_L8_try_end;
9026  __pyx_L3_error:;
9027 
9028  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1005
9029  * try:
9030  * _import_umath()
9031  * except Exception: # <<<<<<<<<<<<<<
9032  * raise ImportError("numpy.core.umath failed to import")
9033  *
9034  */
9035  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
9036  if (__pyx_t_4) {
9037  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
9038  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1005, __pyx_L5_except_error)
9039  __Pyx_GOTREF(__pyx_t_5);
9040  __Pyx_GOTREF(__pyx_t_6);
9041  __Pyx_GOTREF(__pyx_t_7);
9042 
9043  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1006
9044  * _import_umath()
9045  * except Exception:
9046  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
9047  *
9048  * cdef inline int import_ufunc() except -1:
9049  */
9050  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1006, __pyx_L5_except_error)
9051  __Pyx_GOTREF(__pyx_t_8);
9052  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
9053  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9054  __PYX_ERR(2, 1006, __pyx_L5_except_error)
9055  }
9056  goto __pyx_L5_except_error;
9057  __pyx_L5_except_error:;
9058 
9059  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1003
9060  *
9061  * cdef inline int import_umath() except -1:
9062  * try: # <<<<<<<<<<<<<<
9063  * _import_umath()
9064  * except Exception:
9065  */
9066  __Pyx_XGIVEREF(__pyx_t_1);
9067  __Pyx_XGIVEREF(__pyx_t_2);
9068  __Pyx_XGIVEREF(__pyx_t_3);
9069  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
9070  goto __pyx_L1_error;
9071  __pyx_L8_try_end:;
9072  }
9073 
9074  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1002
9075  * raise ImportError("numpy.core.multiarray failed to import")
9076  *
9077  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
9078  * try:
9079  * _import_umath()
9080  */
9081 
9082  /* function exit code */
9083  __pyx_r = 0;
9084  goto __pyx_L0;
9085  __pyx_L1_error:;
9086  __Pyx_XDECREF(__pyx_t_5);
9087  __Pyx_XDECREF(__pyx_t_6);
9088  __Pyx_XDECREF(__pyx_t_7);
9089  __Pyx_XDECREF(__pyx_t_8);
9090  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
9091  __pyx_r = -1;
9092  __pyx_L0:;
9093  __Pyx_RefNannyFinishContext();
9094  return __pyx_r;
9095 }
9096 
9097 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1008
9098  * raise ImportError("numpy.core.umath failed to import")
9099  *
9100  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
9101  * try:
9102  * _import_umath()
9103  */
9104 
9105 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
9106  int __pyx_r;
9107  __Pyx_RefNannyDeclarations
9108  PyObject *__pyx_t_1 = NULL;
9109  PyObject *__pyx_t_2 = NULL;
9110  PyObject *__pyx_t_3 = NULL;
9111  int __pyx_t_4;
9112  PyObject *__pyx_t_5 = NULL;
9113  PyObject *__pyx_t_6 = NULL;
9114  PyObject *__pyx_t_7 = NULL;
9115  PyObject *__pyx_t_8 = NULL;
9116  __Pyx_RefNannySetupContext("import_ufunc", 0);
9117 
9118  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1009
9119  *
9120  * cdef inline int import_ufunc() except -1:
9121  * try: # <<<<<<<<<<<<<<
9122  * _import_umath()
9123  * except Exception:
9124  */
9125  {
9126  __Pyx_PyThreadState_declare
9127  __Pyx_PyThreadState_assign
9128  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
9129  __Pyx_XGOTREF(__pyx_t_1);
9130  __Pyx_XGOTREF(__pyx_t_2);
9131  __Pyx_XGOTREF(__pyx_t_3);
9132  /*try:*/ {
9133 
9134  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1010
9135  * cdef inline int import_ufunc() except -1:
9136  * try:
9137  * _import_umath() # <<<<<<<<<<<<<<
9138  * except Exception:
9139  * raise ImportError("numpy.core.umath failed to import")
9140  */
9141  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1010, __pyx_L3_error)
9142 
9143  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1009
9144  *
9145  * cdef inline int import_ufunc() except -1:
9146  * try: # <<<<<<<<<<<<<<
9147  * _import_umath()
9148  * except Exception:
9149  */
9150  }
9151  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
9152  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
9153  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9154  goto __pyx_L8_try_end;
9155  __pyx_L3_error:;
9156 
9157  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1011
9158  * try:
9159  * _import_umath()
9160  * except Exception: # <<<<<<<<<<<<<<
9161  * raise ImportError("numpy.core.umath failed to import")
9162  */
9163  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
9164  if (__pyx_t_4) {
9165  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
9166  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1011, __pyx_L5_except_error)
9167  __Pyx_GOTREF(__pyx_t_5);
9168  __Pyx_GOTREF(__pyx_t_6);
9169  __Pyx_GOTREF(__pyx_t_7);
9170 
9171  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1012
9172  * _import_umath()
9173  * except Exception:
9174  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
9175  */
9176  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1012, __pyx_L5_except_error)
9177  __Pyx_GOTREF(__pyx_t_8);
9178  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
9179  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9180  __PYX_ERR(2, 1012, __pyx_L5_except_error)
9181  }
9182  goto __pyx_L5_except_error;
9183  __pyx_L5_except_error:;
9184 
9185  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1009
9186  *
9187  * cdef inline int import_ufunc() except -1:
9188  * try: # <<<<<<<<<<<<<<
9189  * _import_umath()
9190  * except Exception:
9191  */
9192  __Pyx_XGIVEREF(__pyx_t_1);
9193  __Pyx_XGIVEREF(__pyx_t_2);
9194  __Pyx_XGIVEREF(__pyx_t_3);
9195  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
9196  goto __pyx_L1_error;
9197  __pyx_L8_try_end:;
9198  }
9199 
9200  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1008
9201  * raise ImportError("numpy.core.umath failed to import")
9202  *
9203  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
9204  * try:
9205  * _import_umath()
9206  */
9207 
9208  /* function exit code */
9209  __pyx_r = 0;
9210  goto __pyx_L0;
9211  __pyx_L1_error:;
9212  __Pyx_XDECREF(__pyx_t_5);
9213  __Pyx_XDECREF(__pyx_t_6);
9214  __Pyx_XDECREF(__pyx_t_7);
9215  __Pyx_XDECREF(__pyx_t_8);
9216  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
9217  __pyx_r = -1;
9218  __pyx_L0:;
9219  __Pyx_RefNannyFinishContext();
9220  return __pyx_r;
9221 }
9222 
9223 /* "View.MemoryView":121
9224  * cdef bint dtype_is_object
9225  *
9226  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
9227  * mode="c", bint allocate_buffer=True):
9228  *
9229  */
9230 
9231 /* Python wrapper */
9232 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
9233 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9234  PyObject *__pyx_v_shape = 0;
9235  Py_ssize_t __pyx_v_itemsize;
9236  PyObject *__pyx_v_format = 0;
9237  PyObject *__pyx_v_mode = 0;
9238  int __pyx_v_allocate_buffer;
9239  int __pyx_r;
9240  __Pyx_RefNannyDeclarations
9241  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
9242  {
9243  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
9244  PyObject* values[5] = {0,0,0,0,0};
9245  values[3] = ((PyObject *)__pyx_n_s_c);
9246  if (unlikely(__pyx_kwds)) {
9247  Py_ssize_t kw_args;
9248  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9249  switch (pos_args) {
9250  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
9251  CYTHON_FALLTHROUGH;
9252  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
9253  CYTHON_FALLTHROUGH;
9254  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9255  CYTHON_FALLTHROUGH;
9256  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9257  CYTHON_FALLTHROUGH;
9258  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9259  CYTHON_FALLTHROUGH;
9260  case 0: break;
9261  default: goto __pyx_L5_argtuple_error;
9262  }
9263  kw_args = PyDict_Size(__pyx_kwds);
9264  switch (pos_args) {
9265  case 0:
9266  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
9267  else goto __pyx_L5_argtuple_error;
9268  CYTHON_FALLTHROUGH;
9269  case 1:
9270  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
9271  else {
9272  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 121, __pyx_L3_error)
9273  }
9274  CYTHON_FALLTHROUGH;
9275  case 2:
9276  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
9277  else {
9278  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 121, __pyx_L3_error)
9279  }
9280  CYTHON_FALLTHROUGH;
9281  case 3:
9282  if (kw_args > 0) {
9283  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
9284  if (value) { values[3] = value; kw_args--; }
9285  }
9286  CYTHON_FALLTHROUGH;
9287  case 4:
9288  if (kw_args > 0) {
9289  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
9290  if (value) { values[4] = value; kw_args--; }
9291  }
9292  }
9293  if (unlikely(kw_args > 0)) {
9294  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 121, __pyx_L3_error)
9295  }
9296  } else {
9297  switch (PyTuple_GET_SIZE(__pyx_args)) {
9298  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
9299  CYTHON_FALLTHROUGH;
9300  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
9301  CYTHON_FALLTHROUGH;
9302  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9303  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9304  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9305  break;
9306  default: goto __pyx_L5_argtuple_error;
9307  }
9308  }
9309  __pyx_v_shape = ((PyObject*)values[0]);
9310  __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 121, __pyx_L3_error)
9311  __pyx_v_format = values[2];
9312  __pyx_v_mode = values[3];
9313  if (values[4]) {
9314  __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
9315  } else {
9316 
9317  /* "View.MemoryView":122
9318  *
9319  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
9320  * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
9321  *
9322  * cdef int idx
9323  */
9324  __pyx_v_allocate_buffer = ((int)1);
9325  }
9326  }
9327  goto __pyx_L4_argument_unpacking_done;
9328  __pyx_L5_argtuple_error:;
9329  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 121, __pyx_L3_error)
9330  __pyx_L3_error:;
9331  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9332  __Pyx_RefNannyFinishContext();
9333  return -1;
9334  __pyx_L4_argument_unpacking_done:;
9335  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 121, __pyx_L1_error)
9336  if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
9337  PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 121, __pyx_L1_error)
9338  }
9339  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
9340 
9341  /* "View.MemoryView":121
9342  * cdef bint dtype_is_object
9343  *
9344  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
9345  * mode="c", bint allocate_buffer=True):
9346  *
9347  */
9348 
9349  /* function exit code */
9350  goto __pyx_L0;
9351  __pyx_L1_error:;
9352  __pyx_r = -1;
9353  __pyx_L0:;
9354  __Pyx_RefNannyFinishContext();
9355  return __pyx_r;
9356 }
9357 
9358 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
9359  int __pyx_v_idx;
9360  Py_ssize_t __pyx_v_i;
9361  Py_ssize_t __pyx_v_dim;
9362  PyObject **__pyx_v_p;
9363  char __pyx_v_order;
9364  int __pyx_r;
9365  __Pyx_RefNannyDeclarations
9366  Py_ssize_t __pyx_t_1;
9367  int __pyx_t_2;
9368  PyObject *__pyx_t_3 = NULL;
9369  int __pyx_t_4;
9370  PyObject *__pyx_t_5 = NULL;
9371  char *__pyx_t_6;
9372  int __pyx_t_7;
9373  Py_ssize_t __pyx_t_8;
9374  PyObject *__pyx_t_9 = NULL;
9375  PyObject *__pyx_t_10 = NULL;
9376  Py_ssize_t __pyx_t_11;
9377  __Pyx_RefNannySetupContext("__cinit__", 0);
9378  __Pyx_INCREF(__pyx_v_format);
9379 
9380  /* "View.MemoryView":128
9381  * cdef PyObject **p
9382  *
9383  * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
9384  * self.itemsize = itemsize
9385  *
9386  */
9387  if (unlikely(__pyx_v_shape == Py_None)) {
9388  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
9389  __PYX_ERR(1, 128, __pyx_L1_error)
9390  }
9391  __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 128, __pyx_L1_error)
9392  __pyx_v_self->ndim = ((int)__pyx_t_1);
9393 
9394  /* "View.MemoryView":129
9395  *
9396  * self.ndim = <int> len(shape)
9397  * self.itemsize = itemsize # <<<<<<<<<<<<<<
9398  *
9399  * if not self.ndim:
9400  */
9401  __pyx_v_self->itemsize = __pyx_v_itemsize;
9402 
9403  /* "View.MemoryView":131
9404  * self.itemsize = itemsize
9405  *
9406  * if not self.ndim: # <<<<<<<<<<<<<<
9407  * raise ValueError("Empty shape tuple for cython.array")
9408  *
9409  */
9410  __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
9411  if (unlikely(__pyx_t_2)) {
9412 
9413  /* "View.MemoryView":132
9414  *
9415  * if not self.ndim:
9416  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
9417  *
9418  * if itemsize <= 0:
9419  */
9420  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 132, __pyx_L1_error)
9421  __Pyx_GOTREF(__pyx_t_3);
9422  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9423  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9424  __PYX_ERR(1, 132, __pyx_L1_error)
9425 
9426  /* "View.MemoryView":131
9427  * self.itemsize = itemsize
9428  *
9429  * if not self.ndim: # <<<<<<<<<<<<<<
9430  * raise ValueError("Empty shape tuple for cython.array")
9431  *
9432  */
9433  }
9434 
9435  /* "View.MemoryView":134
9436  * raise ValueError("Empty shape tuple for cython.array")
9437  *
9438  * if itemsize <= 0: # <<<<<<<<<<<<<<
9439  * raise ValueError("itemsize <= 0 for cython.array")
9440  *
9441  */
9442  __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
9443  if (unlikely(__pyx_t_2)) {
9444 
9445  /* "View.MemoryView":135
9446  *
9447  * if itemsize <= 0:
9448  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
9449  *
9450  * if not isinstance(format, bytes):
9451  */
9452  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 135, __pyx_L1_error)
9453  __Pyx_GOTREF(__pyx_t_3);
9454  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9455  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9456  __PYX_ERR(1, 135, __pyx_L1_error)
9457 
9458  /* "View.MemoryView":134
9459  * raise ValueError("Empty shape tuple for cython.array")
9460  *
9461  * if itemsize <= 0: # <<<<<<<<<<<<<<
9462  * raise ValueError("itemsize <= 0 for cython.array")
9463  *
9464  */
9465  }
9466 
9467  /* "View.MemoryView":137
9468  * raise ValueError("itemsize <= 0 for cython.array")
9469  *
9470  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
9471  * format = format.encode('ASCII')
9472  * self._format = format # keep a reference to the byte string
9473  */
9474  __pyx_t_2 = PyBytes_Check(__pyx_v_format);
9475  __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
9476  if (__pyx_t_4) {
9477 
9478  /* "View.MemoryView":138
9479  *
9480  * if not isinstance(format, bytes):
9481  * format = format.encode('ASCII') # <<<<<<<<<<<<<<
9482  * self._format = format # keep a reference to the byte string
9483  * self.format = self._format
9484  */
9485  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 138, __pyx_L1_error)
9486  __Pyx_GOTREF(__pyx_t_3);
9487  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 138, __pyx_L1_error)
9488  __Pyx_GOTREF(__pyx_t_5);
9489  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9490  __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5);
9491  __pyx_t_5 = 0;
9492 
9493  /* "View.MemoryView":137
9494  * raise ValueError("itemsize <= 0 for cython.array")
9495  *
9496  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
9497  * format = format.encode('ASCII')
9498  * self._format = format # keep a reference to the byte string
9499  */
9500  }
9501 
9502  /* "View.MemoryView":139
9503  * if not isinstance(format, bytes):
9504  * format = format.encode('ASCII')
9505  * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
9506  * self.format = self._format
9507  *
9508  */
9509  if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 139, __pyx_L1_error)
9510  __pyx_t_5 = __pyx_v_format;
9511  __Pyx_INCREF(__pyx_t_5);
9512  __Pyx_GIVEREF(__pyx_t_5);
9513  __Pyx_GOTREF(__pyx_v_self->_format);
9514  __Pyx_DECREF(__pyx_v_self->_format);
9515  __pyx_v_self->_format = ((PyObject*)__pyx_t_5);
9516  __pyx_t_5 = 0;
9517 
9518  /* "View.MemoryView":140
9519  * format = format.encode('ASCII')
9520  * self._format = format # keep a reference to the byte string
9521  * self.format = self._format # <<<<<<<<<<<<<<
9522  *
9523  *
9524  */
9525  if (unlikely(__pyx_v_self->_format == Py_None)) {
9526  PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
9527  __PYX_ERR(1, 140, __pyx_L1_error)
9528  }
9529  __pyx_t_6 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(1, 140, __pyx_L1_error)
9530  __pyx_v_self->format = __pyx_t_6;
9531 
9532  /* "View.MemoryView":143
9533  *
9534  *
9535  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
9536  * self._strides = self._shape + self.ndim
9537  *
9538  */
9539  __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
9540 
9541  /* "View.MemoryView":144
9542  *
9543  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
9544  * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
9545  *
9546  * if not self._shape:
9547  */
9548  __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
9549 
9550  /* "View.MemoryView":146
9551  * self._strides = self._shape + self.ndim
9552  *
9553  * if not self._shape: # <<<<<<<<<<<<<<
9554  * raise MemoryError("unable to allocate shape and strides.")
9555  *
9556  */
9557  __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
9558  if (unlikely(__pyx_t_4)) {
9559 
9560  /* "View.MemoryView":147
9561  *
9562  * if not self._shape:
9563  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
9564  *
9565  *
9566  */
9567  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 147, __pyx_L1_error)
9568  __Pyx_GOTREF(__pyx_t_5);
9569  __Pyx_Raise(__pyx_t_5, 0, 0, 0);
9570  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9571  __PYX_ERR(1, 147, __pyx_L1_error)
9572 
9573  /* "View.MemoryView":146
9574  * self._strides = self._shape + self.ndim
9575  *
9576  * if not self._shape: # <<<<<<<<<<<<<<
9577  * raise MemoryError("unable to allocate shape and strides.")
9578  *
9579  */
9580  }
9581 
9582  /* "View.MemoryView":150
9583  *
9584  *
9585  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
9586  * if dim <= 0:
9587  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
9588  */
9589  __pyx_t_7 = 0;
9590  __pyx_t_5 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = 0;
9591  for (;;) {
9592  if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
9593  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9594  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 150, __pyx_L1_error)
9595  #else
9596  __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 150, __pyx_L1_error)
9597  __Pyx_GOTREF(__pyx_t_3);
9598  #endif
9599  __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 150, __pyx_L1_error)
9600  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9601  __pyx_v_dim = __pyx_t_8;
9602  __pyx_v_idx = __pyx_t_7;
9603  __pyx_t_7 = (__pyx_t_7 + 1);
9604 
9605  /* "View.MemoryView":151
9606  *
9607  * for idx, dim in enumerate(shape):
9608  * if dim <= 0: # <<<<<<<<<<<<<<
9609  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
9610  * self._shape[idx] = dim
9611  */
9612  __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
9613  if (unlikely(__pyx_t_4)) {
9614 
9615  /* "View.MemoryView":152
9616  * for idx, dim in enumerate(shape):
9617  * if dim <= 0:
9618  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<<
9619  * self._shape[idx] = dim
9620  *
9621  */
9622  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 152, __pyx_L1_error)
9623  __Pyx_GOTREF(__pyx_t_3);
9624  __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 152, __pyx_L1_error)
9625  __Pyx_GOTREF(__pyx_t_9);
9626  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 152, __pyx_L1_error)
9627  __Pyx_GOTREF(__pyx_t_10);
9628  __Pyx_GIVEREF(__pyx_t_3);
9629  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3);
9630  __Pyx_GIVEREF(__pyx_t_9);
9631  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9);
9632  __pyx_t_3 = 0;
9633  __pyx_t_9 = 0;
9634  __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 152, __pyx_L1_error)
9635  __Pyx_GOTREF(__pyx_t_9);
9636  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9637  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 152, __pyx_L1_error)
9638  __Pyx_GOTREF(__pyx_t_10);
9639  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9640  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
9641  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9642  __PYX_ERR(1, 152, __pyx_L1_error)
9643 
9644  /* "View.MemoryView":151
9645  *
9646  * for idx, dim in enumerate(shape):
9647  * if dim <= 0: # <<<<<<<<<<<<<<
9648  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
9649  * self._shape[idx] = dim
9650  */
9651  }
9652 
9653  /* "View.MemoryView":153
9654  * if dim <= 0:
9655  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
9656  * self._shape[idx] = dim # <<<<<<<<<<<<<<
9657  *
9658  * cdef char order
9659  */
9660  (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
9661 
9662  /* "View.MemoryView":150
9663  *
9664  *
9665  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
9666  * if dim <= 0:
9667  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
9668  */
9669  }
9670  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9671 
9672  /* "View.MemoryView":156
9673  *
9674  * cdef char order
9675  * if mode == 'fortran': # <<<<<<<<<<<<<<
9676  * order = b'F'
9677  * self.mode = u'fortran'
9678  */
9679  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 156, __pyx_L1_error)
9680  if (__pyx_t_4) {
9681 
9682  /* "View.MemoryView":157
9683  * cdef char order
9684  * if mode == 'fortran':
9685  * order = b'F' # <<<<<<<<<<<<<<
9686  * self.mode = u'fortran'
9687  * elif mode == 'c':
9688  */
9689  __pyx_v_order = 'F';
9690 
9691  /* "View.MemoryView":158
9692  * if mode == 'fortran':
9693  * order = b'F'
9694  * self.mode = u'fortran' # <<<<<<<<<<<<<<
9695  * elif mode == 'c':
9696  * order = b'C'
9697  */
9698  __Pyx_INCREF(__pyx_n_u_fortran);
9699  __Pyx_GIVEREF(__pyx_n_u_fortran);
9700  __Pyx_GOTREF(__pyx_v_self->mode);
9701  __Pyx_DECREF(__pyx_v_self->mode);
9702  __pyx_v_self->mode = __pyx_n_u_fortran;
9703 
9704  /* "View.MemoryView":156
9705  *
9706  * cdef char order
9707  * if mode == 'fortran': # <<<<<<<<<<<<<<
9708  * order = b'F'
9709  * self.mode = u'fortran'
9710  */
9711  goto __pyx_L10;
9712  }
9713 
9714  /* "View.MemoryView":159
9715  * order = b'F'
9716  * self.mode = u'fortran'
9717  * elif mode == 'c': # <<<<<<<<<<<<<<
9718  * order = b'C'
9719  * self.mode = u'c'
9720  */
9721  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 159, __pyx_L1_error)
9722  if (likely(__pyx_t_4)) {
9723 
9724  /* "View.MemoryView":160
9725  * self.mode = u'fortran'
9726  * elif mode == 'c':
9727  * order = b'C' # <<<<<<<<<<<<<<
9728  * self.mode = u'c'
9729  * else:
9730  */
9731  __pyx_v_order = 'C';
9732 
9733  /* "View.MemoryView":161
9734  * elif mode == 'c':
9735  * order = b'C'
9736  * self.mode = u'c' # <<<<<<<<<<<<<<
9737  * else:
9738  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
9739  */
9740  __Pyx_INCREF(__pyx_n_u_c);
9741  __Pyx_GIVEREF(__pyx_n_u_c);
9742  __Pyx_GOTREF(__pyx_v_self->mode);
9743  __Pyx_DECREF(__pyx_v_self->mode);
9744  __pyx_v_self->mode = __pyx_n_u_c;
9745 
9746  /* "View.MemoryView":159
9747  * order = b'F'
9748  * self.mode = u'fortran'
9749  * elif mode == 'c': # <<<<<<<<<<<<<<
9750  * order = b'C'
9751  * self.mode = u'c'
9752  */
9753  goto __pyx_L10;
9754  }
9755 
9756  /* "View.MemoryView":163
9757  * self.mode = u'c'
9758  * else:
9759  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<<
9760  *
9761  * self.len = fill_contig_strides_array(self._shape, self._strides,
9762  */
9763  /*else*/ {
9764  __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 163, __pyx_L1_error)
9765  __Pyx_GOTREF(__pyx_t_5);
9766  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 163, __pyx_L1_error)
9767  __Pyx_GOTREF(__pyx_t_10);
9768  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9769  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
9770  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9771  __PYX_ERR(1, 163, __pyx_L1_error)
9772  }
9773  __pyx_L10:;
9774 
9775  /* "View.MemoryView":165
9776  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
9777  *
9778  * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
9779  * itemsize, self.ndim, order)
9780  *
9781  */
9782  __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
9783 
9784  /* "View.MemoryView":168
9785  * itemsize, self.ndim, order)
9786  *
9787  * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
9788  * self.dtype_is_object = format == b'O'
9789  * if allocate_buffer:
9790  */
9791  __pyx_v_self->free_data = __pyx_v_allocate_buffer;
9792 
9793  /* "View.MemoryView":169
9794  *
9795  * self.free_data = allocate_buffer
9796  * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
9797  * if allocate_buffer:
9798  *
9799  */
9800  __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 169, __pyx_L1_error)
9801  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 169, __pyx_L1_error)
9802  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9803  __pyx_v_self->dtype_is_object = __pyx_t_4;
9804 
9805  /* "View.MemoryView":170
9806  * self.free_data = allocate_buffer
9807  * self.dtype_is_object = format == b'O'
9808  * if allocate_buffer: # <<<<<<<<<<<<<<
9809  *
9810  *
9811  */
9812  __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
9813  if (__pyx_t_4) {
9814 
9815  /* "View.MemoryView":173
9816  *
9817  *
9818  * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
9819  * if not self.data:
9820  * raise MemoryError("unable to allocate array data.")
9821  */
9822  __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
9823 
9824  /* "View.MemoryView":174
9825  *
9826  * self.data = <char *>malloc(self.len)
9827  * if not self.data: # <<<<<<<<<<<<<<
9828  * raise MemoryError("unable to allocate array data.")
9829  *
9830  */
9831  __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
9832  if (unlikely(__pyx_t_4)) {
9833 
9834  /* "View.MemoryView":175
9835  * self.data = <char *>malloc(self.len)
9836  * if not self.data:
9837  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
9838  *
9839  * if self.dtype_is_object:
9840  */
9841  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 175, __pyx_L1_error)
9842  __Pyx_GOTREF(__pyx_t_10);
9843  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
9844  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9845  __PYX_ERR(1, 175, __pyx_L1_error)
9846 
9847  /* "View.MemoryView":174
9848  *
9849  * self.data = <char *>malloc(self.len)
9850  * if not self.data: # <<<<<<<<<<<<<<
9851  * raise MemoryError("unable to allocate array data.")
9852  *
9853  */
9854  }
9855 
9856  /* "View.MemoryView":177
9857  * raise MemoryError("unable to allocate array data.")
9858  *
9859  * if self.dtype_is_object: # <<<<<<<<<<<<<<
9860  * p = <PyObject **> self.data
9861  * for i in range(self.len / itemsize):
9862  */
9863  __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
9864  if (__pyx_t_4) {
9865 
9866  /* "View.MemoryView":178
9867  *
9868  * if self.dtype_is_object:
9869  * p = <PyObject **> self.data # <<<<<<<<<<<<<<
9870  * for i in range(self.len / itemsize):
9871  * p[i] = Py_None
9872  */
9873  __pyx_v_p = ((PyObject **)__pyx_v_self->data);
9874 
9875  /* "View.MemoryView":179
9876  * if self.dtype_is_object:
9877  * p = <PyObject **> self.data
9878  * for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
9879  * p[i] = Py_None
9880  * Py_INCREF(Py_None)
9881  */
9882  if (unlikely(__pyx_v_itemsize == 0)) {
9883  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
9884  __PYX_ERR(1, 179, __pyx_L1_error)
9885  }
9886  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
9887  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
9888  __PYX_ERR(1, 179, __pyx_L1_error)
9889  }
9890  __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
9891  __pyx_t_8 = __pyx_t_1;
9892  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_8; __pyx_t_11+=1) {
9893  __pyx_v_i = __pyx_t_11;
9894 
9895  /* "View.MemoryView":180
9896  * p = <PyObject **> self.data
9897  * for i in range(self.len / itemsize):
9898  * p[i] = Py_None # <<<<<<<<<<<<<<
9899  * Py_INCREF(Py_None)
9900  *
9901  */
9902  (__pyx_v_p[__pyx_v_i]) = Py_None;
9903 
9904  /* "View.MemoryView":181
9905  * for i in range(self.len / itemsize):
9906  * p[i] = Py_None
9907  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
9908  *
9909  * @cname('getbuffer')
9910  */
9911  Py_INCREF(Py_None);
9912  }
9913 
9914  /* "View.MemoryView":177
9915  * raise MemoryError("unable to allocate array data.")
9916  *
9917  * if self.dtype_is_object: # <<<<<<<<<<<<<<
9918  * p = <PyObject **> self.data
9919  * for i in range(self.len / itemsize):
9920  */
9921  }
9922 
9923  /* "View.MemoryView":170
9924  * self.free_data = allocate_buffer
9925  * self.dtype_is_object = format == b'O'
9926  * if allocate_buffer: # <<<<<<<<<<<<<<
9927  *
9928  *
9929  */
9930  }
9931 
9932  /* "View.MemoryView":121
9933  * cdef bint dtype_is_object
9934  *
9935  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
9936  * mode="c", bint allocate_buffer=True):
9937  *
9938  */
9939 
9940  /* function exit code */
9941  __pyx_r = 0;
9942  goto __pyx_L0;
9943  __pyx_L1_error:;
9944  __Pyx_XDECREF(__pyx_t_3);
9945  __Pyx_XDECREF(__pyx_t_5);
9946  __Pyx_XDECREF(__pyx_t_9);
9947  __Pyx_XDECREF(__pyx_t_10);
9948  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9949  __pyx_r = -1;
9950  __pyx_L0:;
9951  __Pyx_XDECREF(__pyx_v_format);
9952  __Pyx_RefNannyFinishContext();
9953  return __pyx_r;
9954 }
9955 
9956 /* "View.MemoryView":184
9957  *
9958  * @cname('getbuffer')
9959  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
9960  * cdef int bufmode = -1
9961  * if self.mode == u"c":
9962  */
9963 
9964 /* Python wrapper */
9965 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
9966 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
9967  int __pyx_r;
9968  __Pyx_RefNannyDeclarations
9969  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
9970  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
9971 
9972  /* function exit code */
9973  __Pyx_RefNannyFinishContext();
9974  return __pyx_r;
9975 }
9976 
9977 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
9978  int __pyx_v_bufmode;
9979  int __pyx_r;
9980  __Pyx_RefNannyDeclarations
9981  int __pyx_t_1;
9982  int __pyx_t_2;
9983  PyObject *__pyx_t_3 = NULL;
9984  char *__pyx_t_4;
9985  Py_ssize_t __pyx_t_5;
9986  int __pyx_t_6;
9987  Py_ssize_t *__pyx_t_7;
9988  if (__pyx_v_info == NULL) {
9989  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
9990  return -1;
9991  }
9992  __Pyx_RefNannySetupContext("__getbuffer__", 0);
9993  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
9994  __Pyx_GIVEREF(__pyx_v_info->obj);
9995 
9996  /* "View.MemoryView":185
9997  * @cname('getbuffer')
9998  * def __getbuffer__(self, Py_buffer *info, int flags):
9999  * cdef int bufmode = -1 # <<<<<<<<<<<<<<
10000  * if self.mode == u"c":
10001  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
10002  */
10003  __pyx_v_bufmode = -1;
10004 
10005  /* "View.MemoryView":186
10006  * def __getbuffer__(self, Py_buffer *info, int flags):
10007  * cdef int bufmode = -1
10008  * if self.mode == u"c": # <<<<<<<<<<<<<<
10009  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
10010  * elif self.mode == u"fortran":
10011  */
10012  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 186, __pyx_L1_error)
10013  __pyx_t_2 = (__pyx_t_1 != 0);
10014  if (__pyx_t_2) {
10015 
10016  /* "View.MemoryView":187
10017  * cdef int bufmode = -1
10018  * if self.mode == u"c":
10019  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
10020  * elif self.mode == u"fortran":
10021  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
10022  */
10023  __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
10024 
10025  /* "View.MemoryView":186
10026  * def __getbuffer__(self, Py_buffer *info, int flags):
10027  * cdef int bufmode = -1
10028  * if self.mode == u"c": # <<<<<<<<<<<<<<
10029  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
10030  * elif self.mode == u"fortran":
10031  */
10032  goto __pyx_L3;
10033  }
10034 
10035  /* "View.MemoryView":188
10036  * if self.mode == u"c":
10037  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
10038  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
10039  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
10040  * if not (flags & bufmode):
10041  */
10042  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 188, __pyx_L1_error)
10043  __pyx_t_1 = (__pyx_t_2 != 0);
10044  if (__pyx_t_1) {
10045 
10046  /* "View.MemoryView":189
10047  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
10048  * elif self.mode == u"fortran":
10049  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
10050  * if not (flags & bufmode):
10051  * raise ValueError("Can only create a buffer that is contiguous in memory.")
10052  */
10053  __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
10054 
10055  /* "View.MemoryView":188
10056  * if self.mode == u"c":
10057  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
10058  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
10059  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
10060  * if not (flags & bufmode):
10061  */
10062  }
10063  __pyx_L3:;
10064 
10065  /* "View.MemoryView":190
10066  * elif self.mode == u"fortran":
10067  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
10068  * if not (flags & bufmode): # <<<<<<<<<<<<<<
10069  * raise ValueError("Can only create a buffer that is contiguous in memory.")
10070  * info.buf = self.data
10071  */
10072  __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
10073  if (unlikely(__pyx_t_1)) {
10074 
10075  /* "View.MemoryView":191
10076  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
10077  * if not (flags & bufmode):
10078  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
10079  * info.buf = self.data
10080  * info.len = self.len
10081  */
10082  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 191, __pyx_L1_error)
10083  __Pyx_GOTREF(__pyx_t_3);
10084  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
10085  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10086  __PYX_ERR(1, 191, __pyx_L1_error)
10087 
10088  /* "View.MemoryView":190
10089  * elif self.mode == u"fortran":
10090  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
10091  * if not (flags & bufmode): # <<<<<<<<<<<<<<
10092  * raise ValueError("Can only create a buffer that is contiguous in memory.")
10093  * info.buf = self.data
10094  */
10095  }
10096 
10097  /* "View.MemoryView":192
10098  * if not (flags & bufmode):
10099  * raise ValueError("Can only create a buffer that is contiguous in memory.")
10100  * info.buf = self.data # <<<<<<<<<<<<<<
10101  * info.len = self.len
10102  * info.ndim = self.ndim
10103  */
10104  __pyx_t_4 = __pyx_v_self->data;
10105  __pyx_v_info->buf = __pyx_t_4;
10106 
10107  /* "View.MemoryView":193
10108  * raise ValueError("Can only create a buffer that is contiguous in memory.")
10109  * info.buf = self.data
10110  * info.len = self.len # <<<<<<<<<<<<<<
10111  * info.ndim = self.ndim
10112  * info.shape = self._shape
10113  */
10114  __pyx_t_5 = __pyx_v_self->len;
10115  __pyx_v_info->len = __pyx_t_5;
10116 
10117  /* "View.MemoryView":194
10118  * info.buf = self.data
10119  * info.len = self.len
10120  * info.ndim = self.ndim # <<<<<<<<<<<<<<
10121  * info.shape = self._shape
10122  * info.strides = self._strides
10123  */
10124  __pyx_t_6 = __pyx_v_self->ndim;
10125  __pyx_v_info->ndim = __pyx_t_6;
10126 
10127  /* "View.MemoryView":195
10128  * info.len = self.len
10129  * info.ndim = self.ndim
10130  * info.shape = self._shape # <<<<<<<<<<<<<<
10131  * info.strides = self._strides
10132  * info.suboffsets = NULL
10133  */
10134  __pyx_t_7 = __pyx_v_self->_shape;
10135  __pyx_v_info->shape = __pyx_t_7;
10136 
10137  /* "View.MemoryView":196
10138  * info.ndim = self.ndim
10139  * info.shape = self._shape
10140  * info.strides = self._strides # <<<<<<<<<<<<<<
10141  * info.suboffsets = NULL
10142  * info.itemsize = self.itemsize
10143  */
10144  __pyx_t_7 = __pyx_v_self->_strides;
10145  __pyx_v_info->strides = __pyx_t_7;
10146 
10147  /* "View.MemoryView":197
10148  * info.shape = self._shape
10149  * info.strides = self._strides
10150  * info.suboffsets = NULL # <<<<<<<<<<<<<<
10151  * info.itemsize = self.itemsize
10152  * info.readonly = 0
10153  */
10154  __pyx_v_info->suboffsets = NULL;
10155 
10156  /* "View.MemoryView":198
10157  * info.strides = self._strides
10158  * info.suboffsets = NULL
10159  * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
10160  * info.readonly = 0
10161  *
10162  */
10163  __pyx_t_5 = __pyx_v_self->itemsize;
10164  __pyx_v_info->itemsize = __pyx_t_5;
10165 
10166  /* "View.MemoryView":199
10167  * info.suboffsets = NULL
10168  * info.itemsize = self.itemsize
10169  * info.readonly = 0 # <<<<<<<<<<<<<<
10170  *
10171  * if flags & PyBUF_FORMAT:
10172  */
10173  __pyx_v_info->readonly = 0;
10174 
10175  /* "View.MemoryView":201
10176  * info.readonly = 0
10177  *
10178  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
10179  * info.format = self.format
10180  * else:
10181  */
10182  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
10183  if (__pyx_t_1) {
10184 
10185  /* "View.MemoryView":202
10186  *
10187  * if flags & PyBUF_FORMAT:
10188  * info.format = self.format # <<<<<<<<<<<<<<
10189  * else:
10190  * info.format = NULL
10191  */
10192  __pyx_t_4 = __pyx_v_self->format;
10193  __pyx_v_info->format = __pyx_t_4;
10194 
10195  /* "View.MemoryView":201
10196  * info.readonly = 0
10197  *
10198  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
10199  * info.format = self.format
10200  * else:
10201  */
10202  goto __pyx_L5;
10203  }
10204 
10205  /* "View.MemoryView":204
10206  * info.format = self.format
10207  * else:
10208  * info.format = NULL # <<<<<<<<<<<<<<
10209  *
10210  * info.obj = self
10211  */
10212  /*else*/ {
10213  __pyx_v_info->format = NULL;
10214  }
10215  __pyx_L5:;
10216 
10217  /* "View.MemoryView":206
10218  * info.format = NULL
10219  *
10220  * info.obj = self # <<<<<<<<<<<<<<
10221  *
10222  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
10223  */
10224  __Pyx_INCREF(((PyObject *)__pyx_v_self));
10225  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
10226  __Pyx_GOTREF(__pyx_v_info->obj);
10227  __Pyx_DECREF(__pyx_v_info->obj);
10228  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
10229 
10230  /* "View.MemoryView":184
10231  *
10232  * @cname('getbuffer')
10233  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
10234  * cdef int bufmode = -1
10235  * if self.mode == u"c":
10236  */
10237 
10238  /* function exit code */
10239  __pyx_r = 0;
10240  goto __pyx_L0;
10241  __pyx_L1_error:;
10242  __Pyx_XDECREF(__pyx_t_3);
10243  __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10244  __pyx_r = -1;
10245  if (__pyx_v_info->obj != NULL) {
10246  __Pyx_GOTREF(__pyx_v_info->obj);
10247  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
10248  }
10249  goto __pyx_L2;
10250  __pyx_L0:;
10251  if (__pyx_v_info->obj == Py_None) {
10252  __Pyx_GOTREF(__pyx_v_info->obj);
10253  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
10254  }
10255  __pyx_L2:;
10256  __Pyx_RefNannyFinishContext();
10257  return __pyx_r;
10258 }
10259 
10260 /* "View.MemoryView":210
10261  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
10262  *
10263  * def __dealloc__(array self): # <<<<<<<<<<<<<<
10264  * if self.callback_free_data != NULL:
10265  * self.callback_free_data(self.data)
10266  */
10267 
10268 /* Python wrapper */
10269 static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
10270 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
10271  __Pyx_RefNannyDeclarations
10272  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
10273  __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
10274 
10275  /* function exit code */
10276  __Pyx_RefNannyFinishContext();
10277 }
10278 
10279 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
10280  __Pyx_RefNannyDeclarations
10281  int __pyx_t_1;
10282  __Pyx_RefNannySetupContext("__dealloc__", 0);
10283 
10284  /* "View.MemoryView":211
10285  *
10286  * def __dealloc__(array self):
10287  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
10288  * self.callback_free_data(self.data)
10289  * elif self.free_data:
10290  */
10291  __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
10292  if (__pyx_t_1) {
10293 
10294  /* "View.MemoryView":212
10295  * def __dealloc__(array self):
10296  * if self.callback_free_data != NULL:
10297  * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
10298  * elif self.free_data:
10299  * if self.dtype_is_object:
10300  */
10301  __pyx_v_self->callback_free_data(__pyx_v_self->data);
10302 
10303  /* "View.MemoryView":211
10304  *
10305  * def __dealloc__(array self):
10306  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
10307  * self.callback_free_data(self.data)
10308  * elif self.free_data:
10309  */
10310  goto __pyx_L3;
10311  }
10312 
10313  /* "View.MemoryView":213
10314  * if self.callback_free_data != NULL:
10315  * self.callback_free_data(self.data)
10316  * elif self.free_data: # <<<<<<<<<<<<<<
10317  * if self.dtype_is_object:
10318  * refcount_objects_in_slice(self.data, self._shape,
10319  */
10320  __pyx_t_1 = (__pyx_v_self->free_data != 0);
10321  if (__pyx_t_1) {
10322 
10323  /* "View.MemoryView":214
10324  * self.callback_free_data(self.data)
10325  * elif self.free_data:
10326  * if self.dtype_is_object: # <<<<<<<<<<<<<<
10327  * refcount_objects_in_slice(self.data, self._shape,
10328  * self._strides, self.ndim, False)
10329  */
10330  __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
10331  if (__pyx_t_1) {
10332 
10333  /* "View.MemoryView":215
10334  * elif self.free_data:
10335  * if self.dtype_is_object:
10336  * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
10337  * self._strides, self.ndim, False)
10338  * free(self.data)
10339  */
10340  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
10341 
10342  /* "View.MemoryView":214
10343  * self.callback_free_data(self.data)
10344  * elif self.free_data:
10345  * if self.dtype_is_object: # <<<<<<<<<<<<<<
10346  * refcount_objects_in_slice(self.data, self._shape,
10347  * self._strides, self.ndim, False)
10348  */
10349  }
10350 
10351  /* "View.MemoryView":217
10352  * refcount_objects_in_slice(self.data, self._shape,
10353  * self._strides, self.ndim, False)
10354  * free(self.data) # <<<<<<<<<<<<<<
10355  * PyObject_Free(self._shape)
10356  *
10357  */
10358  free(__pyx_v_self->data);
10359 
10360  /* "View.MemoryView":213
10361  * if self.callback_free_data != NULL:
10362  * self.callback_free_data(self.data)
10363  * elif self.free_data: # <<<<<<<<<<<<<<
10364  * if self.dtype_is_object:
10365  * refcount_objects_in_slice(self.data, self._shape,
10366  */
10367  }
10368  __pyx_L3:;
10369 
10370  /* "View.MemoryView":218
10371  * self._strides, self.ndim, False)
10372  * free(self.data)
10373  * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
10374  *
10375  * @property
10376  */
10377  PyObject_Free(__pyx_v_self->_shape);
10378 
10379  /* "View.MemoryView":210
10380  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
10381  *
10382  * def __dealloc__(array self): # <<<<<<<<<<<<<<
10383  * if self.callback_free_data != NULL:
10384  * self.callback_free_data(self.data)
10385  */
10386 
10387  /* function exit code */
10388  __Pyx_RefNannyFinishContext();
10389 }
10390 
10391 /* "View.MemoryView":221
10392  *
10393  * @property
10394  * def memview(self): # <<<<<<<<<<<<<<
10395  * return self.get_memview()
10396  *
10397  */
10398 
10399 /* Python wrapper */
10400 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
10401 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
10402  PyObject *__pyx_r = 0;
10403  __Pyx_RefNannyDeclarations
10404  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10405  __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
10406 
10407  /* function exit code */
10408  __Pyx_RefNannyFinishContext();
10409  return __pyx_r;
10410 }
10411 
10412 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
10413  PyObject *__pyx_r = NULL;
10414  __Pyx_RefNannyDeclarations
10415  PyObject *__pyx_t_1 = NULL;
10416  __Pyx_RefNannySetupContext("__get__", 0);
10417 
10418  /* "View.MemoryView":222
10419  * @property
10420  * def memview(self):
10421  * return self.get_memview() # <<<<<<<<<<<<<<
10422  *
10423  * @cname('get_memview')
10424  */
10425  __Pyx_XDECREF(__pyx_r);
10426  __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 222, __pyx_L1_error)
10427  __Pyx_GOTREF(__pyx_t_1);
10428  __pyx_r = __pyx_t_1;
10429  __pyx_t_1 = 0;
10430  goto __pyx_L0;
10431 
10432  /* "View.MemoryView":221
10433  *
10434  * @property
10435  * def memview(self): # <<<<<<<<<<<<<<
10436  * return self.get_memview()
10437  *
10438  */
10439 
10440  /* function exit code */
10441  __pyx_L1_error:;
10442  __Pyx_XDECREF(__pyx_t_1);
10443  __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10444  __pyx_r = NULL;
10445  __pyx_L0:;
10446  __Pyx_XGIVEREF(__pyx_r);
10447  __Pyx_RefNannyFinishContext();
10448  return __pyx_r;
10449 }
10450 
10451 /* "View.MemoryView":225
10452  *
10453  * @cname('get_memview')
10454  * cdef get_memview(self): # <<<<<<<<<<<<<<
10455  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
10456  * return memoryview(self, flags, self.dtype_is_object)
10457  */
10458 
10459 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
10460  int __pyx_v_flags;
10461  PyObject *__pyx_r = NULL;
10462  __Pyx_RefNannyDeclarations
10463  PyObject *__pyx_t_1 = NULL;
10464  PyObject *__pyx_t_2 = NULL;
10465  PyObject *__pyx_t_3 = NULL;
10466  __Pyx_RefNannySetupContext("get_memview", 0);
10467 
10468  /* "View.MemoryView":226
10469  * @cname('get_memview')
10470  * cdef get_memview(self):
10471  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
10472  * return memoryview(self, flags, self.dtype_is_object)
10473  *
10474  */
10475  __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
10476 
10477  /* "View.MemoryView":227
10478  * cdef get_memview(self):
10479  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
10480  * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
10481  *
10482  * def __len__(self):
10483  */
10484  __Pyx_XDECREF(__pyx_r);
10485  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 227, __pyx_L1_error)
10486  __Pyx_GOTREF(__pyx_t_1);
10487  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 227, __pyx_L1_error)
10488  __Pyx_GOTREF(__pyx_t_2);
10489  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 227, __pyx_L1_error)
10490  __Pyx_GOTREF(__pyx_t_3);
10491  __Pyx_INCREF(((PyObject *)__pyx_v_self));
10492  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
10493  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
10494  __Pyx_GIVEREF(__pyx_t_1);
10495  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
10496  __Pyx_GIVEREF(__pyx_t_2);
10497  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
10498  __pyx_t_1 = 0;
10499  __pyx_t_2 = 0;
10500  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 227, __pyx_L1_error)
10501  __Pyx_GOTREF(__pyx_t_2);
10502  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10503  __pyx_r = __pyx_t_2;
10504  __pyx_t_2 = 0;
10505  goto __pyx_L0;
10506 
10507  /* "View.MemoryView":225
10508  *
10509  * @cname('get_memview')
10510  * cdef get_memview(self): # <<<<<<<<<<<<<<
10511  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
10512  * return memoryview(self, flags, self.dtype_is_object)
10513  */
10514 
10515  /* function exit code */
10516  __pyx_L1_error:;
10517  __Pyx_XDECREF(__pyx_t_1);
10518  __Pyx_XDECREF(__pyx_t_2);
10519  __Pyx_XDECREF(__pyx_t_3);
10520  __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
10521  __pyx_r = 0;
10522  __pyx_L0:;
10523  __Pyx_XGIVEREF(__pyx_r);
10524  __Pyx_RefNannyFinishContext();
10525  return __pyx_r;
10526 }
10527 
10528 /* "View.MemoryView":229
10529  * return memoryview(self, flags, self.dtype_is_object)
10530  *
10531  * def __len__(self): # <<<<<<<<<<<<<<
10532  * return self._shape[0]
10533  *
10534  */
10535 
10536 /* Python wrapper */
10537 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
10538 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
10539  Py_ssize_t __pyx_r;
10540  __Pyx_RefNannyDeclarations
10541  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
10542  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
10543 
10544  /* function exit code */
10545  __Pyx_RefNannyFinishContext();
10546  return __pyx_r;
10547 }
10548 
10549 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
10550  Py_ssize_t __pyx_r;
10551  __Pyx_RefNannyDeclarations
10552  __Pyx_RefNannySetupContext("__len__", 0);
10553 
10554  /* "View.MemoryView":230
10555  *
10556  * def __len__(self):
10557  * return self._shape[0] # <<<<<<<<<<<<<<
10558  *
10559  * def __getattr__(self, attr):
10560  */
10561  __pyx_r = (__pyx_v_self->_shape[0]);
10562  goto __pyx_L0;
10563 
10564  /* "View.MemoryView":229
10565  * return memoryview(self, flags, self.dtype_is_object)
10566  *
10567  * def __len__(self): # <<<<<<<<<<<<<<
10568  * return self._shape[0]
10569  *
10570  */
10571 
10572  /* function exit code */
10573  __pyx_L0:;
10574  __Pyx_RefNannyFinishContext();
10575  return __pyx_r;
10576 }
10577 
10578 /* "View.MemoryView":232
10579  * return self._shape[0]
10580  *
10581  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
10582  * return getattr(self.memview, attr)
10583  *
10584  */
10585 
10586 /* Python wrapper */
10587 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
10588 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
10589  PyObject *__pyx_r = 0;
10590  __Pyx_RefNannyDeclarations
10591  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
10592  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
10593 
10594  /* function exit code */
10595  __Pyx_RefNannyFinishContext();
10596  return __pyx_r;
10597 }
10598 
10599 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
10600  PyObject *__pyx_r = NULL;
10601  __Pyx_RefNannyDeclarations
10602  PyObject *__pyx_t_1 = NULL;
10603  PyObject *__pyx_t_2 = NULL;
10604  __Pyx_RefNannySetupContext("__getattr__", 0);
10605 
10606  /* "View.MemoryView":233
10607  *
10608  * def __getattr__(self, attr):
10609  * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
10610  *
10611  * def __getitem__(self, item):
10612  */
10613  __Pyx_XDECREF(__pyx_r);
10614  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 233, __pyx_L1_error)
10615  __Pyx_GOTREF(__pyx_t_1);
10616  __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 233, __pyx_L1_error)
10617  __Pyx_GOTREF(__pyx_t_2);
10618  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10619  __pyx_r = __pyx_t_2;
10620  __pyx_t_2 = 0;
10621  goto __pyx_L0;
10622 
10623  /* "View.MemoryView":232
10624  * return self._shape[0]
10625  *
10626  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
10627  * return getattr(self.memview, attr)
10628  *
10629  */
10630 
10631  /* function exit code */
10632  __pyx_L1_error:;
10633  __Pyx_XDECREF(__pyx_t_1);
10634  __Pyx_XDECREF(__pyx_t_2);
10635  __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10636  __pyx_r = NULL;
10637  __pyx_L0:;
10638  __Pyx_XGIVEREF(__pyx_r);
10639  __Pyx_RefNannyFinishContext();
10640  return __pyx_r;
10641 }
10642 
10643 /* "View.MemoryView":235
10644  * return getattr(self.memview, attr)
10645  *
10646  * def __getitem__(self, item): # <<<<<<<<<<<<<<
10647  * return self.memview[item]
10648  *
10649  */
10650 
10651 /* Python wrapper */
10652 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
10653 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
10654  PyObject *__pyx_r = 0;
10655  __Pyx_RefNannyDeclarations
10656  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
10657  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
10658 
10659  /* function exit code */
10660  __Pyx_RefNannyFinishContext();
10661  return __pyx_r;
10662 }
10663 
10664 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
10665  PyObject *__pyx_r = NULL;
10666  __Pyx_RefNannyDeclarations
10667  PyObject *__pyx_t_1 = NULL;
10668  PyObject *__pyx_t_2 = NULL;
10669  __Pyx_RefNannySetupContext("__getitem__", 0);
10670 
10671  /* "View.MemoryView":236
10672  *
10673  * def __getitem__(self, item):
10674  * return self.memview[item] # <<<<<<<<<<<<<<
10675  *
10676  * def __setitem__(self, item, value):
10677  */
10678  __Pyx_XDECREF(__pyx_r);
10679  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 236, __pyx_L1_error)
10680  __Pyx_GOTREF(__pyx_t_1);
10681  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 236, __pyx_L1_error)
10682  __Pyx_GOTREF(__pyx_t_2);
10683  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10684  __pyx_r = __pyx_t_2;
10685  __pyx_t_2 = 0;
10686  goto __pyx_L0;
10687 
10688  /* "View.MemoryView":235
10689  * return getattr(self.memview, attr)
10690  *
10691  * def __getitem__(self, item): # <<<<<<<<<<<<<<
10692  * return self.memview[item]
10693  *
10694  */
10695 
10696  /* function exit code */
10697  __pyx_L1_error:;
10698  __Pyx_XDECREF(__pyx_t_1);
10699  __Pyx_XDECREF(__pyx_t_2);
10700  __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10701  __pyx_r = NULL;
10702  __pyx_L0:;
10703  __Pyx_XGIVEREF(__pyx_r);
10704  __Pyx_RefNannyFinishContext();
10705  return __pyx_r;
10706 }
10707 
10708 /* "View.MemoryView":238
10709  * return self.memview[item]
10710  *
10711  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
10712  * self.memview[item] = value
10713  *
10714  */
10715 
10716 /* Python wrapper */
10717 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
10718 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
10719  int __pyx_r;
10720  __Pyx_RefNannyDeclarations
10721  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
10722  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
10723 
10724  /* function exit code */
10725  __Pyx_RefNannyFinishContext();
10726  return __pyx_r;
10727 }
10728 
10729 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
10730  int __pyx_r;
10731  __Pyx_RefNannyDeclarations
10732  PyObject *__pyx_t_1 = NULL;
10733  __Pyx_RefNannySetupContext("__setitem__", 0);
10734 
10735  /* "View.MemoryView":239
10736  *
10737  * def __setitem__(self, item, value):
10738  * self.memview[item] = value # <<<<<<<<<<<<<<
10739  *
10740  *
10741  */
10742  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 239, __pyx_L1_error)
10743  __Pyx_GOTREF(__pyx_t_1);
10744  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 239, __pyx_L1_error)
10745  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10746 
10747  /* "View.MemoryView":238
10748  * return self.memview[item]
10749  *
10750  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
10751  * self.memview[item] = value
10752  *
10753  */
10754 
10755  /* function exit code */
10756  __pyx_r = 0;
10757  goto __pyx_L0;
10758  __pyx_L1_error:;
10759  __Pyx_XDECREF(__pyx_t_1);
10760  __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10761  __pyx_r = -1;
10762  __pyx_L0:;
10763  __Pyx_RefNannyFinishContext();
10764  return __pyx_r;
10765 }
10766 
10767 /* "(tree fragment)":1
10768  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
10769  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10770  * def __setstate_cython__(self, __pyx_state):
10771  */
10772 
10773 /* Python wrapper */
10774 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
10775 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10776  PyObject *__pyx_r = 0;
10777  __Pyx_RefNannyDeclarations
10778  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
10779  __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
10780 
10781  /* function exit code */
10782  __Pyx_RefNannyFinishContext();
10783  return __pyx_r;
10784 }
10785 
10786 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
10787  PyObject *__pyx_r = NULL;
10788  __Pyx_RefNannyDeclarations
10789  PyObject *__pyx_t_1 = NULL;
10790  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
10791 
10792  /* "(tree fragment)":2
10793  * def __reduce_cython__(self):
10794  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
10795  * def __setstate_cython__(self, __pyx_state):
10796  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10797  */
10798  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
10799  __Pyx_GOTREF(__pyx_t_1);
10800  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
10801  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10802  __PYX_ERR(1, 2, __pyx_L1_error)
10803 
10804  /* "(tree fragment)":1
10805  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
10806  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10807  * def __setstate_cython__(self, __pyx_state):
10808  */
10809 
10810  /* function exit code */
10811  __pyx_L1_error:;
10812  __Pyx_XDECREF(__pyx_t_1);
10813  __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10814  __pyx_r = NULL;
10815  __Pyx_XGIVEREF(__pyx_r);
10816  __Pyx_RefNannyFinishContext();
10817  return __pyx_r;
10818 }
10819 
10820 /* "(tree fragment)":3
10821  * def __reduce_cython__(self):
10822  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10823  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
10824  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10825  */
10826 
10827 /* Python wrapper */
10828 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
10829 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10830  PyObject *__pyx_r = 0;
10831  __Pyx_RefNannyDeclarations
10832  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
10833  __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
10834 
10835  /* function exit code */
10836  __Pyx_RefNannyFinishContext();
10837  return __pyx_r;
10838 }
10839 
10840 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
10841  PyObject *__pyx_r = NULL;
10842  __Pyx_RefNannyDeclarations
10843  PyObject *__pyx_t_1 = NULL;
10844  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
10845 
10846  /* "(tree fragment)":4
10847  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10848  * def __setstate_cython__(self, __pyx_state):
10849  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
10850  */
10851  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
10852  __Pyx_GOTREF(__pyx_t_1);
10853  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
10854  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10855  __PYX_ERR(1, 4, __pyx_L1_error)
10856 
10857  /* "(tree fragment)":3
10858  * def __reduce_cython__(self):
10859  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10860  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
10861  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10862  */
10863 
10864  /* function exit code */
10865  __pyx_L1_error:;
10866  __Pyx_XDECREF(__pyx_t_1);
10867  __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10868  __pyx_r = NULL;
10869  __Pyx_XGIVEREF(__pyx_r);
10870  __Pyx_RefNannyFinishContext();
10871  return __pyx_r;
10872 }
10873 
10874 /* "View.MemoryView":243
10875  *
10876  * @cname("__pyx_array_new")
10877  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
10878  * char *mode, char *buf):
10879  * cdef array result
10880  */
10881 
10882 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) {
10883  struct __pyx_array_obj *__pyx_v_result = 0;
10884  struct __pyx_array_obj *__pyx_r = NULL;
10885  __Pyx_RefNannyDeclarations
10886  int __pyx_t_1;
10887  PyObject *__pyx_t_2 = NULL;
10888  PyObject *__pyx_t_3 = NULL;
10889  PyObject *__pyx_t_4 = NULL;
10890  PyObject *__pyx_t_5 = NULL;
10891  __Pyx_RefNannySetupContext("array_cwrapper", 0);
10892 
10893  /* "View.MemoryView":247
10894  * cdef array result
10895  *
10896  * if buf == NULL: # <<<<<<<<<<<<<<
10897  * result = array(shape, itemsize, format, mode.decode('ASCII'))
10898  * else:
10899  */
10900  __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
10901  if (__pyx_t_1) {
10902 
10903  /* "View.MemoryView":248
10904  *
10905  * if buf == NULL:
10906  * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<<
10907  * else:
10908  * result = array(shape, itemsize, format, mode.decode('ASCII'),
10909  */
10910  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 248, __pyx_L1_error)
10911  __Pyx_GOTREF(__pyx_t_2);
10912  __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 248, __pyx_L1_error)
10913  __Pyx_GOTREF(__pyx_t_3);
10914  __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 248, __pyx_L1_error)
10915  __Pyx_GOTREF(__pyx_t_4);
10916  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 248, __pyx_L1_error)
10917  __Pyx_GOTREF(__pyx_t_5);
10918  __Pyx_INCREF(__pyx_v_shape);
10919  __Pyx_GIVEREF(__pyx_v_shape);
10920  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
10921  __Pyx_GIVEREF(__pyx_t_2);
10922  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
10923  __Pyx_GIVEREF(__pyx_t_3);
10924  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
10925  __Pyx_GIVEREF(__pyx_t_4);
10926  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
10927  __pyx_t_2 = 0;
10928  __pyx_t_3 = 0;
10929  __pyx_t_4 = 0;
10930  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 248, __pyx_L1_error)
10931  __Pyx_GOTREF(__pyx_t_4);
10932  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10933  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
10934  __pyx_t_4 = 0;
10935 
10936  /* "View.MemoryView":247
10937  * cdef array result
10938  *
10939  * if buf == NULL: # <<<<<<<<<<<<<<
10940  * result = array(shape, itemsize, format, mode.decode('ASCII'))
10941  * else:
10942  */
10943  goto __pyx_L3;
10944  }
10945 
10946  /* "View.MemoryView":250
10947  * result = array(shape, itemsize, format, mode.decode('ASCII'))
10948  * else:
10949  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
10950  * allocate_buffer=False)
10951  * result.data = buf
10952  */
10953  /*else*/ {
10954  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 250, __pyx_L1_error)
10955  __Pyx_GOTREF(__pyx_t_4);
10956  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 250, __pyx_L1_error)
10957  __Pyx_GOTREF(__pyx_t_5);
10958  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 250, __pyx_L1_error)
10959  __Pyx_GOTREF(__pyx_t_3);
10960  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 250, __pyx_L1_error)
10961  __Pyx_GOTREF(__pyx_t_2);
10962  __Pyx_INCREF(__pyx_v_shape);
10963  __Pyx_GIVEREF(__pyx_v_shape);
10964  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
10965  __Pyx_GIVEREF(__pyx_t_4);
10966  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
10967  __Pyx_GIVEREF(__pyx_t_5);
10968  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
10969  __Pyx_GIVEREF(__pyx_t_3);
10970  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
10971  __pyx_t_4 = 0;
10972  __pyx_t_5 = 0;
10973  __pyx_t_3 = 0;
10974 
10975  /* "View.MemoryView":251
10976  * else:
10977  * result = array(shape, itemsize, format, mode.decode('ASCII'),
10978  * allocate_buffer=False) # <<<<<<<<<<<<<<
10979  * result.data = buf
10980  *
10981  */
10982  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 251, __pyx_L1_error)
10983  __Pyx_GOTREF(__pyx_t_3);
10984  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 251, __pyx_L1_error)
10985 
10986  /* "View.MemoryView":250
10987  * result = array(shape, itemsize, format, mode.decode('ASCII'))
10988  * else:
10989  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
10990  * allocate_buffer=False)
10991  * result.data = buf
10992  */
10993  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 250, __pyx_L1_error)
10994  __Pyx_GOTREF(__pyx_t_5);
10995  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10996  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10997  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
10998  __pyx_t_5 = 0;
10999 
11000  /* "View.MemoryView":252
11001  * result = array(shape, itemsize, format, mode.decode('ASCII'),
11002  * allocate_buffer=False)
11003  * result.data = buf # <<<<<<<<<<<<<<
11004  *
11005  * return result
11006  */
11007  __pyx_v_result->data = __pyx_v_buf;
11008  }
11009  __pyx_L3:;
11010 
11011  /* "View.MemoryView":254
11012  * result.data = buf
11013  *
11014  * return result # <<<<<<<<<<<<<<
11015  *
11016  *
11017  */
11018  __Pyx_XDECREF(((PyObject *)__pyx_r));
11019  __Pyx_INCREF(((PyObject *)__pyx_v_result));
11020  __pyx_r = __pyx_v_result;
11021  goto __pyx_L0;
11022 
11023  /* "View.MemoryView":243
11024  *
11025  * @cname("__pyx_array_new")
11026  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
11027  * char *mode, char *buf):
11028  * cdef array result
11029  */
11030 
11031  /* function exit code */
11032  __pyx_L1_error:;
11033  __Pyx_XDECREF(__pyx_t_2);
11034  __Pyx_XDECREF(__pyx_t_3);
11035  __Pyx_XDECREF(__pyx_t_4);
11036  __Pyx_XDECREF(__pyx_t_5);
11037  __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
11038  __pyx_r = 0;
11039  __pyx_L0:;
11040  __Pyx_XDECREF((PyObject *)__pyx_v_result);
11041  __Pyx_XGIVEREF((PyObject *)__pyx_r);
11042  __Pyx_RefNannyFinishContext();
11043  return __pyx_r;
11044 }
11045 
11046 /* "View.MemoryView":280
11047  * cdef class Enum(object):
11048  * cdef object name
11049  * def __init__(self, name): # <<<<<<<<<<<<<<
11050  * self.name = name
11051  * def __repr__(self):
11052  */
11053 
11054 /* Python wrapper */
11055 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
11056 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11057  PyObject *__pyx_v_name = 0;
11058  int __pyx_r;
11059  __Pyx_RefNannyDeclarations
11060  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
11061  {
11062  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
11063  PyObject* values[1] = {0};
11064  if (unlikely(__pyx_kwds)) {
11065  Py_ssize_t kw_args;
11066  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
11067  switch (pos_args) {
11068  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11069  CYTHON_FALLTHROUGH;
11070  case 0: break;
11071  default: goto __pyx_L5_argtuple_error;
11072  }
11073  kw_args = PyDict_Size(__pyx_kwds);
11074  switch (pos_args) {
11075  case 0:
11076  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
11077  else goto __pyx_L5_argtuple_error;
11078  }
11079  if (unlikely(kw_args > 0)) {
11080  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 280, __pyx_L3_error)
11081  }
11082  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
11083  goto __pyx_L5_argtuple_error;
11084  } else {
11085  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11086  }
11087  __pyx_v_name = values[0];
11088  }
11089  goto __pyx_L4_argument_unpacking_done;
11090  __pyx_L5_argtuple_error:;
11091  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 280, __pyx_L3_error)
11092  __pyx_L3_error:;
11093  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11094  __Pyx_RefNannyFinishContext();
11095  return -1;
11096  __pyx_L4_argument_unpacking_done:;
11097  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
11098 
11099  /* function exit code */
11100  __Pyx_RefNannyFinishContext();
11101  return __pyx_r;
11102 }
11103 
11104 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
11105  int __pyx_r;
11106  __Pyx_RefNannyDeclarations
11107  __Pyx_RefNannySetupContext("__init__", 0);
11108 
11109  /* "View.MemoryView":281
11110  * cdef object name
11111  * def __init__(self, name):
11112  * self.name = name # <<<<<<<<<<<<<<
11113  * def __repr__(self):
11114  * return self.name
11115  */
11116  __Pyx_INCREF(__pyx_v_name);
11117  __Pyx_GIVEREF(__pyx_v_name);
11118  __Pyx_GOTREF(__pyx_v_self->name);
11119  __Pyx_DECREF(__pyx_v_self->name);
11120  __pyx_v_self->name = __pyx_v_name;
11121 
11122  /* "View.MemoryView":280
11123  * cdef class Enum(object):
11124  * cdef object name
11125  * def __init__(self, name): # <<<<<<<<<<<<<<
11126  * self.name = name
11127  * def __repr__(self):
11128  */
11129 
11130  /* function exit code */
11131  __pyx_r = 0;
11132  __Pyx_RefNannyFinishContext();
11133  return __pyx_r;
11134 }
11135 
11136 /* "View.MemoryView":282
11137  * def __init__(self, name):
11138  * self.name = name
11139  * def __repr__(self): # <<<<<<<<<<<<<<
11140  * return self.name
11141  *
11142  */
11143 
11144 /* Python wrapper */
11145 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
11146 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
11147  PyObject *__pyx_r = 0;
11148  __Pyx_RefNannyDeclarations
11149  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
11150  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
11151 
11152  /* function exit code */
11153  __Pyx_RefNannyFinishContext();
11154  return __pyx_r;
11155 }
11156 
11157 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
11158  PyObject *__pyx_r = NULL;
11159  __Pyx_RefNannyDeclarations
11160  __Pyx_RefNannySetupContext("__repr__", 0);
11161 
11162  /* "View.MemoryView":283
11163  * self.name = name
11164  * def __repr__(self):
11165  * return self.name # <<<<<<<<<<<<<<
11166  *
11167  * cdef generic = Enum("<strided and direct or indirect>")
11168  */
11169  __Pyx_XDECREF(__pyx_r);
11170  __Pyx_INCREF(__pyx_v_self->name);
11171  __pyx_r = __pyx_v_self->name;
11172  goto __pyx_L0;
11173 
11174  /* "View.MemoryView":282
11175  * def __init__(self, name):
11176  * self.name = name
11177  * def __repr__(self): # <<<<<<<<<<<<<<
11178  * return self.name
11179  *
11180  */
11181 
11182  /* function exit code */
11183  __pyx_L0:;
11184  __Pyx_XGIVEREF(__pyx_r);
11185  __Pyx_RefNannyFinishContext();
11186  return __pyx_r;
11187 }
11188 
11189 /* "(tree fragment)":1
11190  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
11191  * cdef bint use_setstate
11192  * state = (self.name,)
11193  */
11194 
11195 /* Python wrapper */
11196 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
11197 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11198  PyObject *__pyx_r = 0;
11199  __Pyx_RefNannyDeclarations
11200  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
11201  __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
11202 
11203  /* function exit code */
11204  __Pyx_RefNannyFinishContext();
11205  return __pyx_r;
11206 }
11207 
11208 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
11209  int __pyx_v_use_setstate;
11210  PyObject *__pyx_v_state = NULL;
11211  PyObject *__pyx_v__dict = NULL;
11212  PyObject *__pyx_r = NULL;
11213  __Pyx_RefNannyDeclarations
11214  PyObject *__pyx_t_1 = NULL;
11215  int __pyx_t_2;
11216  int __pyx_t_3;
11217  PyObject *__pyx_t_4 = NULL;
11218  PyObject *__pyx_t_5 = NULL;
11219  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
11220 
11221  /* "(tree fragment)":3
11222  * def __reduce_cython__(self):
11223  * cdef bint use_setstate
11224  * state = (self.name,) # <<<<<<<<<<<<<<
11225  * _dict = getattr(self, '__dict__', None)
11226  * if _dict is not None:
11227  */
11228  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error)
11229  __Pyx_GOTREF(__pyx_t_1);
11230  __Pyx_INCREF(__pyx_v_self->name);
11231  __Pyx_GIVEREF(__pyx_v_self->name);
11232  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
11233  __pyx_v_state = ((PyObject*)__pyx_t_1);
11234  __pyx_t_1 = 0;
11235 
11236  /* "(tree fragment)":4
11237  * cdef bint use_setstate
11238  * state = (self.name,)
11239  * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
11240  * if _dict is not None:
11241  * state += (_dict,)
11242  */
11243  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
11244  __Pyx_GOTREF(__pyx_t_1);
11245  __pyx_v__dict = __pyx_t_1;
11246  __pyx_t_1 = 0;
11247 
11248  /* "(tree fragment)":5
11249  * state = (self.name,)
11250  * _dict = getattr(self, '__dict__', None)
11251  * if _dict is not None: # <<<<<<<<<<<<<<
11252  * state += (_dict,)
11253  * use_setstate = True
11254  */
11255  __pyx_t_2 = (__pyx_v__dict != Py_None);
11256  __pyx_t_3 = (__pyx_t_2 != 0);
11257  if (__pyx_t_3) {
11258 
11259  /* "(tree fragment)":6
11260  * _dict = getattr(self, '__dict__', None)
11261  * if _dict is not None:
11262  * state += (_dict,) # <<<<<<<<<<<<<<
11263  * use_setstate = True
11264  * else:
11265  */
11266  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
11267  __Pyx_GOTREF(__pyx_t_1);
11268  __Pyx_INCREF(__pyx_v__dict);
11269  __Pyx_GIVEREF(__pyx_v__dict);
11270  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
11271  __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
11272  __Pyx_GOTREF(__pyx_t_4);
11273  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11274  __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
11275  __pyx_t_4 = 0;
11276 
11277  /* "(tree fragment)":7
11278  * if _dict is not None:
11279  * state += (_dict,)
11280  * use_setstate = True # <<<<<<<<<<<<<<
11281  * else:
11282  * use_setstate = self.name is not None
11283  */
11284  __pyx_v_use_setstate = 1;
11285 
11286  /* "(tree fragment)":5
11287  * state = (self.name,)
11288  * _dict = getattr(self, '__dict__', None)
11289  * if _dict is not None: # <<<<<<<<<<<<<<
11290  * state += (_dict,)
11291  * use_setstate = True
11292  */
11293  goto __pyx_L3;
11294  }
11295 
11296  /* "(tree fragment)":9
11297  * use_setstate = True
11298  * else:
11299  * use_setstate = self.name is not None # <<<<<<<<<<<<<<
11300  * if use_setstate:
11301  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
11302  */
11303  /*else*/ {
11304  __pyx_t_3 = (__pyx_v_self->name != Py_None);
11305  __pyx_v_use_setstate = __pyx_t_3;
11306  }
11307  __pyx_L3:;
11308 
11309  /* "(tree fragment)":10
11310  * else:
11311  * use_setstate = self.name is not None
11312  * if use_setstate: # <<<<<<<<<<<<<<
11313  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
11314  * else:
11315  */
11316  __pyx_t_3 = (__pyx_v_use_setstate != 0);
11317  if (__pyx_t_3) {
11318 
11319  /* "(tree fragment)":11
11320  * use_setstate = self.name is not None
11321  * if use_setstate:
11322  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state # <<<<<<<<<<<<<<
11323  * else:
11324  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
11325  */
11326  __Pyx_XDECREF(__pyx_r);
11327  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 11, __pyx_L1_error)
11328  __Pyx_GOTREF(__pyx_t_4);
11329  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 11, __pyx_L1_error)
11330  __Pyx_GOTREF(__pyx_t_1);
11331  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11332  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11333  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11334  __Pyx_INCREF(__pyx_int_184977713);
11335  __Pyx_GIVEREF(__pyx_int_184977713);
11336  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
11337  __Pyx_INCREF(Py_None);
11338  __Pyx_GIVEREF(Py_None);
11339  PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
11340  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 11, __pyx_L1_error)
11341  __Pyx_GOTREF(__pyx_t_5);
11342  __Pyx_GIVEREF(__pyx_t_4);
11343  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
11344  __Pyx_GIVEREF(__pyx_t_1);
11345  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
11346  __Pyx_INCREF(__pyx_v_state);
11347  __Pyx_GIVEREF(__pyx_v_state);
11348  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
11349  __pyx_t_4 = 0;
11350  __pyx_t_1 = 0;
11351  __pyx_r = __pyx_t_5;
11352  __pyx_t_5 = 0;
11353  goto __pyx_L0;
11354 
11355  /* "(tree fragment)":10
11356  * else:
11357  * use_setstate = self.name is not None
11358  * if use_setstate: # <<<<<<<<<<<<<<
11359  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
11360  * else:
11361  */
11362  }
11363 
11364  /* "(tree fragment)":13
11365  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
11366  * else:
11367  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) # <<<<<<<<<<<<<<
11368  * def __setstate_cython__(self, __pyx_state):
11369  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
11370  */
11371  /*else*/ {
11372  __Pyx_XDECREF(__pyx_r);
11373  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
11374  __Pyx_GOTREF(__pyx_t_5);
11375  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
11376  __Pyx_GOTREF(__pyx_t_1);
11377  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11378  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11379  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11380  __Pyx_INCREF(__pyx_int_184977713);
11381  __Pyx_GIVEREF(__pyx_int_184977713);
11382  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
11383  __Pyx_INCREF(__pyx_v_state);
11384  __Pyx_GIVEREF(__pyx_v_state);
11385  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
11386  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
11387  __Pyx_GOTREF(__pyx_t_4);
11388  __Pyx_GIVEREF(__pyx_t_5);
11389  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
11390  __Pyx_GIVEREF(__pyx_t_1);
11391  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
11392  __pyx_t_5 = 0;
11393  __pyx_t_1 = 0;
11394  __pyx_r = __pyx_t_4;
11395  __pyx_t_4 = 0;
11396  goto __pyx_L0;
11397  }
11398 
11399  /* "(tree fragment)":1
11400  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
11401  * cdef bint use_setstate
11402  * state = (self.name,)
11403  */
11404 
11405  /* function exit code */
11406  __pyx_L1_error:;
11407  __Pyx_XDECREF(__pyx_t_1);
11408  __Pyx_XDECREF(__pyx_t_4);
11409  __Pyx_XDECREF(__pyx_t_5);
11410  __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11411  __pyx_r = NULL;
11412  __pyx_L0:;
11413  __Pyx_XDECREF(__pyx_v_state);
11414  __Pyx_XDECREF(__pyx_v__dict);
11415  __Pyx_XGIVEREF(__pyx_r);
11416  __Pyx_RefNannyFinishContext();
11417  return __pyx_r;
11418 }
11419 
11420 /* "(tree fragment)":14
11421  * else:
11422  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
11423  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
11424  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
11425  */
11426 
11427 /* Python wrapper */
11428 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
11429 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
11430  PyObject *__pyx_r = 0;
11431  __Pyx_RefNannyDeclarations
11432  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
11433  __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
11434 
11435  /* function exit code */
11436  __Pyx_RefNannyFinishContext();
11437  return __pyx_r;
11438 }
11439 
11440 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
11441  PyObject *__pyx_r = NULL;
11442  __Pyx_RefNannyDeclarations
11443  PyObject *__pyx_t_1 = NULL;
11444  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
11445 
11446  /* "(tree fragment)":15
11447  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
11448  * def __setstate_cython__(self, __pyx_state):
11449  * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
11450  */
11451  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 15, __pyx_L1_error)
11452  __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
11453  __Pyx_GOTREF(__pyx_t_1);
11454  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11455 
11456  /* "(tree fragment)":14
11457  * else:
11458  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
11459  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
11460  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
11461  */
11462 
11463  /* function exit code */
11464  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11465  goto __pyx_L0;
11466  __pyx_L1_error:;
11467  __Pyx_XDECREF(__pyx_t_1);
11468  __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11469  __pyx_r = NULL;
11470  __pyx_L0:;
11471  __Pyx_XGIVEREF(__pyx_r);
11472  __Pyx_RefNannyFinishContext();
11473  return __pyx_r;
11474 }
11475 
11476 /* "View.MemoryView":297
11477  *
11478  * @cname('__pyx_align_pointer')
11479  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
11480  * "Align pointer memory on a given boundary"
11481  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
11482  */
11483 
11484 static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
11485  Py_intptr_t __pyx_v_aligned_p;
11486  size_t __pyx_v_offset;
11487  void *__pyx_r;
11488  int __pyx_t_1;
11489 
11490  /* "View.MemoryView":299
11491  * cdef void *align_pointer(void *memory, size_t alignment) nogil:
11492  * "Align pointer memory on a given boundary"
11493  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory # <<<<<<<<<<<<<<
11494  * cdef size_t offset
11495  *
11496  */
11497  __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
11498 
11499  /* "View.MemoryView":303
11500  *
11501  * with cython.cdivision(True):
11502  * offset = aligned_p % alignment # <<<<<<<<<<<<<<
11503  *
11504  * if offset > 0:
11505  */
11506  __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
11507 
11508  /* "View.MemoryView":305
11509  * offset = aligned_p % alignment
11510  *
11511  * if offset > 0: # <<<<<<<<<<<<<<
11512  * aligned_p += alignment - offset
11513  *
11514  */
11515  __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
11516  if (__pyx_t_1) {
11517 
11518  /* "View.MemoryView":306
11519  *
11520  * if offset > 0:
11521  * aligned_p += alignment - offset # <<<<<<<<<<<<<<
11522  *
11523  * return <void *> aligned_p
11524  */
11525  __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
11526 
11527  /* "View.MemoryView":305
11528  * offset = aligned_p % alignment
11529  *
11530  * if offset > 0: # <<<<<<<<<<<<<<
11531  * aligned_p += alignment - offset
11532  *
11533  */
11534  }
11535 
11536  /* "View.MemoryView":308
11537  * aligned_p += alignment - offset
11538  *
11539  * return <void *> aligned_p # <<<<<<<<<<<<<<
11540  *
11541  *
11542  */
11543  __pyx_r = ((void *)__pyx_v_aligned_p);
11544  goto __pyx_L0;
11545 
11546  /* "View.MemoryView":297
11547  *
11548  * @cname('__pyx_align_pointer')
11549  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
11550  * "Align pointer memory on a given boundary"
11551  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
11552  */
11553 
11554  /* function exit code */
11555  __pyx_L0:;
11556  return __pyx_r;
11557 }
11558 
11559 /* "View.MemoryView":344
11560  * cdef __Pyx_TypeInfo *typeinfo
11561  *
11562  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
11563  * self.obj = obj
11564  * self.flags = flags
11565  */
11566 
11567 /* Python wrapper */
11568 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
11569 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11570  PyObject *__pyx_v_obj = 0;
11571  int __pyx_v_flags;
11572  int __pyx_v_dtype_is_object;
11573  int __pyx_r;
11574  __Pyx_RefNannyDeclarations
11575  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
11576  {
11577  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
11578  PyObject* values[3] = {0,0,0};
11579  if (unlikely(__pyx_kwds)) {
11580  Py_ssize_t kw_args;
11581  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
11582  switch (pos_args) {
11583  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11584  CYTHON_FALLTHROUGH;
11585  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11586  CYTHON_FALLTHROUGH;
11587  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11588  CYTHON_FALLTHROUGH;
11589  case 0: break;
11590  default: goto __pyx_L5_argtuple_error;
11591  }
11592  kw_args = PyDict_Size(__pyx_kwds);
11593  switch (pos_args) {
11594  case 0:
11595  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
11596  else goto __pyx_L5_argtuple_error;
11597  CYTHON_FALLTHROUGH;
11598  case 1:
11599  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
11600  else {
11601  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 344, __pyx_L3_error)
11602  }
11603  CYTHON_FALLTHROUGH;
11604  case 2:
11605  if (kw_args > 0) {
11606  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
11607  if (value) { values[2] = value; kw_args--; }
11608  }
11609  }
11610  if (unlikely(kw_args > 0)) {
11611  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 344, __pyx_L3_error)
11612  }
11613  } else {
11614  switch (PyTuple_GET_SIZE(__pyx_args)) {
11615  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11616  CYTHON_FALLTHROUGH;
11617  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11618  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11619  break;
11620  default: goto __pyx_L5_argtuple_error;
11621  }
11622  }
11623  __pyx_v_obj = values[0];
11624  __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 344, __pyx_L3_error)
11625  if (values[2]) {
11626  __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 344, __pyx_L3_error)
11627  } else {
11628  __pyx_v_dtype_is_object = ((int)0);
11629  }
11630  }
11631  goto __pyx_L4_argument_unpacking_done;
11632  __pyx_L5_argtuple_error:;
11633  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 344, __pyx_L3_error)
11634  __pyx_L3_error:;
11635  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11636  __Pyx_RefNannyFinishContext();
11637  return -1;
11638  __pyx_L4_argument_unpacking_done:;
11639  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
11640 
11641  /* function exit code */
11642  __Pyx_RefNannyFinishContext();
11643  return __pyx_r;
11644 }
11645 
11646 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
11647  int __pyx_r;
11648  __Pyx_RefNannyDeclarations
11649  int __pyx_t_1;
11650  int __pyx_t_2;
11651  int __pyx_t_3;
11652  int __pyx_t_4;
11653  __Pyx_RefNannySetupContext("__cinit__", 0);
11654 
11655  /* "View.MemoryView":345
11656  *
11657  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
11658  * self.obj = obj # <<<<<<<<<<<<<<
11659  * self.flags = flags
11660  * if type(self) is memoryview or obj is not None:
11661  */
11662  __Pyx_INCREF(__pyx_v_obj);
11663  __Pyx_GIVEREF(__pyx_v_obj);
11664  __Pyx_GOTREF(__pyx_v_self->obj);
11665  __Pyx_DECREF(__pyx_v_self->obj);
11666  __pyx_v_self->obj = __pyx_v_obj;
11667 
11668  /* "View.MemoryView":346
11669  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
11670  * self.obj = obj
11671  * self.flags = flags # <<<<<<<<<<<<<<
11672  * if type(self) is memoryview or obj is not None:
11673  * __Pyx_GetBuffer(obj, &self.view, flags)
11674  */
11675  __pyx_v_self->flags = __pyx_v_flags;
11676 
11677  /* "View.MemoryView":347
11678  * self.obj = obj
11679  * self.flags = flags
11680  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
11681  * __Pyx_GetBuffer(obj, &self.view, flags)
11682  * if <PyObject *> self.view.obj == NULL:
11683  */
11684  __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
11685  __pyx_t_3 = (__pyx_t_2 != 0);
11686  if (!__pyx_t_3) {
11687  } else {
11688  __pyx_t_1 = __pyx_t_3;
11689  goto __pyx_L4_bool_binop_done;
11690  }
11691  __pyx_t_3 = (__pyx_v_obj != Py_None);
11692  __pyx_t_2 = (__pyx_t_3 != 0);
11693  __pyx_t_1 = __pyx_t_2;
11694  __pyx_L4_bool_binop_done:;
11695  if (__pyx_t_1) {
11696 
11697  /* "View.MemoryView":348
11698  * self.flags = flags
11699  * if type(self) is memoryview or obj is not None:
11700  * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
11701  * if <PyObject *> self.view.obj == NULL:
11702  * (<__pyx_buffer *> &self.view).obj = Py_None
11703  */
11704  __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 348, __pyx_L1_error)
11705 
11706  /* "View.MemoryView":349
11707  * if type(self) is memoryview or obj is not None:
11708  * __Pyx_GetBuffer(obj, &self.view, flags)
11709  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
11710  * (<__pyx_buffer *> &self.view).obj = Py_None
11711  * Py_INCREF(Py_None)
11712  */
11713  __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
11714  if (__pyx_t_1) {
11715 
11716  /* "View.MemoryView":350
11717  * __Pyx_GetBuffer(obj, &self.view, flags)
11718  * if <PyObject *> self.view.obj == NULL:
11719  * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
11720  * Py_INCREF(Py_None)
11721  *
11722  */
11723  ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
11724 
11725  /* "View.MemoryView":351
11726  * if <PyObject *> self.view.obj == NULL:
11727  * (<__pyx_buffer *> &self.view).obj = Py_None
11728  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
11729  *
11730  * global __pyx_memoryview_thread_locks_used
11731  */
11732  Py_INCREF(Py_None);
11733 
11734  /* "View.MemoryView":349
11735  * if type(self) is memoryview or obj is not None:
11736  * __Pyx_GetBuffer(obj, &self.view, flags)
11737  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
11738  * (<__pyx_buffer *> &self.view).obj = Py_None
11739  * Py_INCREF(Py_None)
11740  */
11741  }
11742 
11743  /* "View.MemoryView":347
11744  * self.obj = obj
11745  * self.flags = flags
11746  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
11747  * __Pyx_GetBuffer(obj, &self.view, flags)
11748  * if <PyObject *> self.view.obj == NULL:
11749  */
11750  }
11751 
11752  /* "View.MemoryView":354
11753  *
11754  * global __pyx_memoryview_thread_locks_used
11755  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
11756  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
11757  * __pyx_memoryview_thread_locks_used += 1
11758  */
11759  __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
11760  if (__pyx_t_1) {
11761 
11762  /* "View.MemoryView":355
11763  * global __pyx_memoryview_thread_locks_used
11764  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
11765  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
11766  * __pyx_memoryview_thread_locks_used += 1
11767  * if self.lock is NULL:
11768  */
11769  __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
11770 
11771  /* "View.MemoryView":356
11772  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
11773  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
11774  * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
11775  * if self.lock is NULL:
11776  * self.lock = PyThread_allocate_lock()
11777  */
11778  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
11779 
11780  /* "View.MemoryView":354
11781  *
11782  * global __pyx_memoryview_thread_locks_used
11783  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
11784  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
11785  * __pyx_memoryview_thread_locks_used += 1
11786  */
11787  }
11788 
11789  /* "View.MemoryView":357
11790  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
11791  * __pyx_memoryview_thread_locks_used += 1
11792  * if self.lock is NULL: # <<<<<<<<<<<<<<
11793  * self.lock = PyThread_allocate_lock()
11794  * if self.lock is NULL:
11795  */
11796  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
11797  if (__pyx_t_1) {
11798 
11799  /* "View.MemoryView":358
11800  * __pyx_memoryview_thread_locks_used += 1
11801  * if self.lock is NULL:
11802  * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
11803  * if self.lock is NULL:
11804  * raise MemoryError
11805  */
11806  __pyx_v_self->lock = PyThread_allocate_lock();
11807 
11808  /* "View.MemoryView":359
11809  * if self.lock is NULL:
11810  * self.lock = PyThread_allocate_lock()
11811  * if self.lock is NULL: # <<<<<<<<<<<<<<
11812  * raise MemoryError
11813  *
11814  */
11815  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
11816  if (unlikely(__pyx_t_1)) {
11817 
11818  /* "View.MemoryView":360
11819  * self.lock = PyThread_allocate_lock()
11820  * if self.lock is NULL:
11821  * raise MemoryError # <<<<<<<<<<<<<<
11822  *
11823  * if flags & PyBUF_FORMAT:
11824  */
11825  PyErr_NoMemory(); __PYX_ERR(1, 360, __pyx_L1_error)
11826 
11827  /* "View.MemoryView":359
11828  * if self.lock is NULL:
11829  * self.lock = PyThread_allocate_lock()
11830  * if self.lock is NULL: # <<<<<<<<<<<<<<
11831  * raise MemoryError
11832  *
11833  */
11834  }
11835 
11836  /* "View.MemoryView":357
11837  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
11838  * __pyx_memoryview_thread_locks_used += 1
11839  * if self.lock is NULL: # <<<<<<<<<<<<<<
11840  * self.lock = PyThread_allocate_lock()
11841  * if self.lock is NULL:
11842  */
11843  }
11844 
11845  /* "View.MemoryView":362
11846  * raise MemoryError
11847  *
11848  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
11849  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
11850  * else:
11851  */
11852  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
11853  if (__pyx_t_1) {
11854 
11855  /* "View.MemoryView":363
11856  *
11857  * if flags & PyBUF_FORMAT:
11858  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
11859  * else:
11860  * self.dtype_is_object = dtype_is_object
11861  */
11862  __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
11863  if (__pyx_t_2) {
11864  } else {
11865  __pyx_t_1 = __pyx_t_2;
11866  goto __pyx_L11_bool_binop_done;
11867  }
11868  __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
11869  __pyx_t_1 = __pyx_t_2;
11870  __pyx_L11_bool_binop_done:;
11871  __pyx_v_self->dtype_is_object = __pyx_t_1;
11872 
11873  /* "View.MemoryView":362
11874  * raise MemoryError
11875  *
11876  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
11877  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
11878  * else:
11879  */
11880  goto __pyx_L10;
11881  }
11882 
11883  /* "View.MemoryView":365
11884  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
11885  * else:
11886  * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
11887  *
11888  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
11889  */
11890  /*else*/ {
11891  __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
11892  }
11893  __pyx_L10:;
11894 
11895  /* "View.MemoryView":367
11896  * self.dtype_is_object = dtype_is_object
11897  *
11898  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
11899  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
11900  * self.typeinfo = NULL
11901  */
11902  __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
11903 
11904  /* "View.MemoryView":369
11905  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
11906  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
11907  * self.typeinfo = NULL # <<<<<<<<<<<<<<
11908  *
11909  * def __dealloc__(memoryview self):
11910  */
11911  __pyx_v_self->typeinfo = NULL;
11912 
11913  /* "View.MemoryView":344
11914  * cdef __Pyx_TypeInfo *typeinfo
11915  *
11916  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
11917  * self.obj = obj
11918  * self.flags = flags
11919  */
11920 
11921  /* function exit code */
11922  __pyx_r = 0;
11923  goto __pyx_L0;
11924  __pyx_L1_error:;
11925  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11926  __pyx_r = -1;
11927  __pyx_L0:;
11928  __Pyx_RefNannyFinishContext();
11929  return __pyx_r;
11930 }
11931 
11932 /* "View.MemoryView":371
11933  * self.typeinfo = NULL
11934  *
11935  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
11936  * if self.obj is not None:
11937  * __Pyx_ReleaseBuffer(&self.view)
11938  */
11939 
11940 /* Python wrapper */
11941 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
11942 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
11943  __Pyx_RefNannyDeclarations
11944  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
11945  __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11946 
11947  /* function exit code */
11948  __Pyx_RefNannyFinishContext();
11949 }
11950 
11951 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
11952  int __pyx_v_i;
11953  __Pyx_RefNannyDeclarations
11954  int __pyx_t_1;
11955  int __pyx_t_2;
11956  int __pyx_t_3;
11957  int __pyx_t_4;
11958  int __pyx_t_5;
11959  PyThread_type_lock __pyx_t_6;
11960  PyThread_type_lock __pyx_t_7;
11961  __Pyx_RefNannySetupContext("__dealloc__", 0);
11962 
11963  /* "View.MemoryView":372
11964  *
11965  * def __dealloc__(memoryview self):
11966  * if self.obj is not None: # <<<<<<<<<<<<<<
11967  * __Pyx_ReleaseBuffer(&self.view)
11968  *
11969  */
11970  __pyx_t_1 = (__pyx_v_self->obj != Py_None);
11971  __pyx_t_2 = (__pyx_t_1 != 0);
11972  if (__pyx_t_2) {
11973 
11974  /* "View.MemoryView":373
11975  * def __dealloc__(memoryview self):
11976  * if self.obj is not None:
11977  * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
11978  *
11979  * cdef int i
11980  */
11981  __Pyx_ReleaseBuffer((&__pyx_v_self->view));
11982 
11983  /* "View.MemoryView":372
11984  *
11985  * def __dealloc__(memoryview self):
11986  * if self.obj is not None: # <<<<<<<<<<<<<<
11987  * __Pyx_ReleaseBuffer(&self.view)
11988  *
11989  */
11990  }
11991 
11992  /* "View.MemoryView":377
11993  * cdef int i
11994  * global __pyx_memoryview_thread_locks_used
11995  * if self.lock != NULL: # <<<<<<<<<<<<<<
11996  * for i in range(__pyx_memoryview_thread_locks_used):
11997  * if __pyx_memoryview_thread_locks[i] is self.lock:
11998  */
11999  __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
12000  if (__pyx_t_2) {
12001 
12002  /* "View.MemoryView":378
12003  * global __pyx_memoryview_thread_locks_used
12004  * if self.lock != NULL:
12005  * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
12006  * if __pyx_memoryview_thread_locks[i] is self.lock:
12007  * __pyx_memoryview_thread_locks_used -= 1
12008  */
12009  __pyx_t_3 = __pyx_memoryview_thread_locks_used;
12010  __pyx_t_4 = __pyx_t_3;
12011  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
12012  __pyx_v_i = __pyx_t_5;
12013 
12014  /* "View.MemoryView":379
12015  * if self.lock != NULL:
12016  * for i in range(__pyx_memoryview_thread_locks_used):
12017  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
12018  * __pyx_memoryview_thread_locks_used -= 1
12019  * if i != __pyx_memoryview_thread_locks_used:
12020  */
12021  __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
12022  if (__pyx_t_2) {
12023 
12024  /* "View.MemoryView":380
12025  * for i in range(__pyx_memoryview_thread_locks_used):
12026  * if __pyx_memoryview_thread_locks[i] is self.lock:
12027  * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
12028  * if i != __pyx_memoryview_thread_locks_used:
12029  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
12030  */
12031  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
12032 
12033  /* "View.MemoryView":381
12034  * if __pyx_memoryview_thread_locks[i] is self.lock:
12035  * __pyx_memoryview_thread_locks_used -= 1
12036  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
12037  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
12038  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
12039  */
12040  __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
12041  if (__pyx_t_2) {
12042 
12043  /* "View.MemoryView":383
12044  * if i != __pyx_memoryview_thread_locks_used:
12045  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
12046  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
12047  * break
12048  * else:
12049  */
12050  __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
12051  __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
12052 
12053  /* "View.MemoryView":382
12054  * __pyx_memoryview_thread_locks_used -= 1
12055  * if i != __pyx_memoryview_thread_locks_used:
12056  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
12057  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
12058  * break
12059  */
12060  (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
12061  (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
12062 
12063  /* "View.MemoryView":381
12064  * if __pyx_memoryview_thread_locks[i] is self.lock:
12065  * __pyx_memoryview_thread_locks_used -= 1
12066  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
12067  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
12068  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
12069  */
12070  }
12071 
12072  /* "View.MemoryView":384
12073  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
12074  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
12075  * break # <<<<<<<<<<<<<<
12076  * else:
12077  * PyThread_free_lock(self.lock)
12078  */
12079  goto __pyx_L6_break;
12080 
12081  /* "View.MemoryView":379
12082  * if self.lock != NULL:
12083  * for i in range(__pyx_memoryview_thread_locks_used):
12084  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
12085  * __pyx_memoryview_thread_locks_used -= 1
12086  * if i != __pyx_memoryview_thread_locks_used:
12087  */
12088  }
12089  }
12090  /*else*/ {
12091 
12092  /* "View.MemoryView":386
12093  * break
12094  * else:
12095  * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
12096  *
12097  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
12098  */
12099  PyThread_free_lock(__pyx_v_self->lock);
12100  }
12101  __pyx_L6_break:;
12102 
12103  /* "View.MemoryView":377
12104  * cdef int i
12105  * global __pyx_memoryview_thread_locks_used
12106  * if self.lock != NULL: # <<<<<<<<<<<<<<
12107  * for i in range(__pyx_memoryview_thread_locks_used):
12108  * if __pyx_memoryview_thread_locks[i] is self.lock:
12109  */
12110  }
12111 
12112  /* "View.MemoryView":371
12113  * self.typeinfo = NULL
12114  *
12115  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
12116  * if self.obj is not None:
12117  * __Pyx_ReleaseBuffer(&self.view)
12118  */
12119 
12120  /* function exit code */
12121  __Pyx_RefNannyFinishContext();
12122 }
12123 
12124 /* "View.MemoryView":388
12125  * PyThread_free_lock(self.lock)
12126  *
12127  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
12128  * cdef Py_ssize_t dim
12129  * cdef char *itemp = <char *> self.view.buf
12130  */
12131 
12132 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
12133  Py_ssize_t __pyx_v_dim;
12134  char *__pyx_v_itemp;
12135  PyObject *__pyx_v_idx = NULL;
12136  char *__pyx_r;
12137  __Pyx_RefNannyDeclarations
12138  Py_ssize_t __pyx_t_1;
12139  PyObject *__pyx_t_2 = NULL;
12140  Py_ssize_t __pyx_t_3;
12141  PyObject *(*__pyx_t_4)(PyObject *);
12142  PyObject *__pyx_t_5 = NULL;
12143  Py_ssize_t __pyx_t_6;
12144  char *__pyx_t_7;
12145  __Pyx_RefNannySetupContext("get_item_pointer", 0);
12146 
12147  /* "View.MemoryView":390
12148  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
12149  * cdef Py_ssize_t dim
12150  * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
12151  *
12152  * for dim, idx in enumerate(index):
12153  */
12154  __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
12155 
12156  /* "View.MemoryView":392
12157  * cdef char *itemp = <char *> self.view.buf
12158  *
12159  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
12160  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
12161  *
12162  */
12163  __pyx_t_1 = 0;
12164  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
12165  __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
12166  __pyx_t_4 = NULL;
12167  } else {
12168  __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 392, __pyx_L1_error)
12169  __Pyx_GOTREF(__pyx_t_2);
12170  __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 392, __pyx_L1_error)
12171  }
12172  for (;;) {
12173  if (likely(!__pyx_t_4)) {
12174  if (likely(PyList_CheckExact(__pyx_t_2))) {
12175  if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
12176  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12177  __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 392, __pyx_L1_error)
12178  #else
12179  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 392, __pyx_L1_error)
12180  __Pyx_GOTREF(__pyx_t_5);
12181  #endif
12182  } else {
12183  if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
12184  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12185  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 392, __pyx_L1_error)
12186  #else
12187  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 392, __pyx_L1_error)
12188  __Pyx_GOTREF(__pyx_t_5);
12189  #endif
12190  }
12191  } else {
12192  __pyx_t_5 = __pyx_t_4(__pyx_t_2);
12193  if (unlikely(!__pyx_t_5)) {
12194  PyObject* exc_type = PyErr_Occurred();
12195  if (exc_type) {
12196  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
12197  else __PYX_ERR(1, 392, __pyx_L1_error)
12198  }
12199  break;
12200  }
12201  __Pyx_GOTREF(__pyx_t_5);
12202  }
12203  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
12204  __pyx_t_5 = 0;
12205  __pyx_v_dim = __pyx_t_1;
12206  __pyx_t_1 = (__pyx_t_1 + 1);
12207 
12208  /* "View.MemoryView":393
12209  *
12210  * for dim, idx in enumerate(index):
12211  * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
12212  *
12213  * return itemp
12214  */
12215  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 393, __pyx_L1_error)
12216  __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(1, 393, __pyx_L1_error)
12217  __pyx_v_itemp = __pyx_t_7;
12218 
12219  /* "View.MemoryView":392
12220  * cdef char *itemp = <char *> self.view.buf
12221  *
12222  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
12223  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
12224  *
12225  */
12226  }
12227  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12228 
12229  /* "View.MemoryView":395
12230  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
12231  *
12232  * return itemp # <<<<<<<<<<<<<<
12233  *
12234  *
12235  */
12236  __pyx_r = __pyx_v_itemp;
12237  goto __pyx_L0;
12238 
12239  /* "View.MemoryView":388
12240  * PyThread_free_lock(self.lock)
12241  *
12242  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
12243  * cdef Py_ssize_t dim
12244  * cdef char *itemp = <char *> self.view.buf
12245  */
12246 
12247  /* function exit code */
12248  __pyx_L1_error:;
12249  __Pyx_XDECREF(__pyx_t_2);
12250  __Pyx_XDECREF(__pyx_t_5);
12251  __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
12252  __pyx_r = NULL;
12253  __pyx_L0:;
12254  __Pyx_XDECREF(__pyx_v_idx);
12255  __Pyx_RefNannyFinishContext();
12256  return __pyx_r;
12257 }
12258 
12259 /* "View.MemoryView":398
12260  *
12261  *
12262  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
12263  * if index is Ellipsis:
12264  * return self
12265  */
12266 
12267 /* Python wrapper */
12268 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
12269 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
12270  PyObject *__pyx_r = 0;
12271  __Pyx_RefNannyDeclarations
12272  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
12273  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
12274 
12275  /* function exit code */
12276  __Pyx_RefNannyFinishContext();
12277  return __pyx_r;
12278 }
12279 
12280 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
12281  PyObject *__pyx_v_have_slices = NULL;
12282  PyObject *__pyx_v_indices = NULL;
12283  char *__pyx_v_itemp;
12284  PyObject *__pyx_r = NULL;
12285  __Pyx_RefNannyDeclarations
12286  int __pyx_t_1;
12287  int __pyx_t_2;
12288  PyObject *__pyx_t_3 = NULL;
12289  PyObject *__pyx_t_4 = NULL;
12290  PyObject *__pyx_t_5 = NULL;
12291  char *__pyx_t_6;
12292  __Pyx_RefNannySetupContext("__getitem__", 0);
12293 
12294  /* "View.MemoryView":399
12295  *
12296  * def __getitem__(memoryview self, object index):
12297  * if index is Ellipsis: # <<<<<<<<<<<<<<
12298  * return self
12299  *
12300  */
12301  __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
12302  __pyx_t_2 = (__pyx_t_1 != 0);
12303  if (__pyx_t_2) {
12304 
12305  /* "View.MemoryView":400
12306  * def __getitem__(memoryview self, object index):
12307  * if index is Ellipsis:
12308  * return self # <<<<<<<<<<<<<<
12309  *
12310  * have_slices, indices = _unellipsify(index, self.view.ndim)
12311  */
12312  __Pyx_XDECREF(__pyx_r);
12313  __Pyx_INCREF(((PyObject *)__pyx_v_self));
12314  __pyx_r = ((PyObject *)__pyx_v_self);
12315  goto __pyx_L0;
12316 
12317  /* "View.MemoryView":399
12318  *
12319  * def __getitem__(memoryview self, object index):
12320  * if index is Ellipsis: # <<<<<<<<<<<<<<
12321  * return self
12322  *
12323  */
12324  }
12325 
12326  /* "View.MemoryView":402
12327  * return self
12328  *
12329  * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
12330  *
12331  * cdef char *itemp
12332  */
12333  __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 402, __pyx_L1_error)
12334  __Pyx_GOTREF(__pyx_t_3);
12335  if (likely(__pyx_t_3 != Py_None)) {
12336  PyObject* sequence = __pyx_t_3;
12337  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
12338  if (unlikely(size != 2)) {
12339  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
12340  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
12341  __PYX_ERR(1, 402, __pyx_L1_error)
12342  }
12343  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12344  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
12345  __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
12346  __Pyx_INCREF(__pyx_t_4);
12347  __Pyx_INCREF(__pyx_t_5);
12348  #else
12349  __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 402, __pyx_L1_error)
12350  __Pyx_GOTREF(__pyx_t_4);
12351  __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 402, __pyx_L1_error)
12352  __Pyx_GOTREF(__pyx_t_5);
12353  #endif
12354  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12355  } else {
12356  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 402, __pyx_L1_error)
12357  }
12358  __pyx_v_have_slices = __pyx_t_4;
12359  __pyx_t_4 = 0;
12360  __pyx_v_indices = __pyx_t_5;
12361  __pyx_t_5 = 0;
12362 
12363  /* "View.MemoryView":405
12364  *
12365  * cdef char *itemp
12366  * if have_slices: # <<<<<<<<<<<<<<
12367  * return memview_slice(self, indices)
12368  * else:
12369  */
12370  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 405, __pyx_L1_error)
12371  if (__pyx_t_2) {
12372 
12373  /* "View.MemoryView":406
12374  * cdef char *itemp
12375  * if have_slices:
12376  * return memview_slice(self, indices) # <<<<<<<<<<<<<<
12377  * else:
12378  * itemp = self.get_item_pointer(indices)
12379  */
12380  __Pyx_XDECREF(__pyx_r);
12381  __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 406, __pyx_L1_error)
12382  __Pyx_GOTREF(__pyx_t_3);
12383  __pyx_r = __pyx_t_3;
12384  __pyx_t_3 = 0;
12385  goto __pyx_L0;
12386 
12387  /* "View.MemoryView":405
12388  *
12389  * cdef char *itemp
12390  * if have_slices: # <<<<<<<<<<<<<<
12391  * return memview_slice(self, indices)
12392  * else:
12393  */
12394  }
12395 
12396  /* "View.MemoryView":408
12397  * return memview_slice(self, indices)
12398  * else:
12399  * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
12400  * return self.convert_item_to_object(itemp)
12401  *
12402  */
12403  /*else*/ {
12404  __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(1, 408, __pyx_L1_error)
12405  __pyx_v_itemp = __pyx_t_6;
12406 
12407  /* "View.MemoryView":409
12408  * else:
12409  * itemp = self.get_item_pointer(indices)
12410  * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
12411  *
12412  * def __setitem__(memoryview self, object index, object value):
12413  */
12414  __Pyx_XDECREF(__pyx_r);
12415  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 409, __pyx_L1_error)
12416  __Pyx_GOTREF(__pyx_t_3);
12417  __pyx_r = __pyx_t_3;
12418  __pyx_t_3 = 0;
12419  goto __pyx_L0;
12420  }
12421 
12422  /* "View.MemoryView":398
12423  *
12424  *
12425  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
12426  * if index is Ellipsis:
12427  * return self
12428  */
12429 
12430  /* function exit code */
12431  __pyx_L1_error:;
12432  __Pyx_XDECREF(__pyx_t_3);
12433  __Pyx_XDECREF(__pyx_t_4);
12434  __Pyx_XDECREF(__pyx_t_5);
12435  __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12436  __pyx_r = NULL;
12437  __pyx_L0:;
12438  __Pyx_XDECREF(__pyx_v_have_slices);
12439  __Pyx_XDECREF(__pyx_v_indices);
12440  __Pyx_XGIVEREF(__pyx_r);
12441  __Pyx_RefNannyFinishContext();
12442  return __pyx_r;
12443 }
12444 
12445 /* "View.MemoryView":411
12446  * return self.convert_item_to_object(itemp)
12447  *
12448  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
12449  * if self.view.readonly:
12450  * raise TypeError("Cannot assign to read-only memoryview")
12451  */
12452 
12453 /* Python wrapper */
12454 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
12455 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
12456  int __pyx_r;
12457  __Pyx_RefNannyDeclarations
12458  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
12459  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
12460 
12461  /* function exit code */
12462  __Pyx_RefNannyFinishContext();
12463  return __pyx_r;
12464 }
12465 
12466 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
12467  PyObject *__pyx_v_have_slices = NULL;
12468  PyObject *__pyx_v_obj = NULL;
12469  int __pyx_r;
12470  __Pyx_RefNannyDeclarations
12471  int __pyx_t_1;
12472  PyObject *__pyx_t_2 = NULL;
12473  PyObject *__pyx_t_3 = NULL;
12474  PyObject *__pyx_t_4 = NULL;
12475  __Pyx_RefNannySetupContext("__setitem__", 0);
12476  __Pyx_INCREF(__pyx_v_index);
12477 
12478  /* "View.MemoryView":412
12479  *
12480  * def __setitem__(memoryview self, object index, object value):
12481  * if self.view.readonly: # <<<<<<<<<<<<<<
12482  * raise TypeError("Cannot assign to read-only memoryview")
12483  *
12484  */
12485  __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
12486  if (unlikely(__pyx_t_1)) {
12487 
12488  /* "View.MemoryView":413
12489  * def __setitem__(memoryview self, object index, object value):
12490  * if self.view.readonly:
12491  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
12492  *
12493  * have_slices, index = _unellipsify(index, self.view.ndim)
12494  */
12495  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 413, __pyx_L1_error)
12496  __Pyx_GOTREF(__pyx_t_2);
12497  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
12498  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12499  __PYX_ERR(1, 413, __pyx_L1_error)
12500 
12501  /* "View.MemoryView":412
12502  *
12503  * def __setitem__(memoryview self, object index, object value):
12504  * if self.view.readonly: # <<<<<<<<<<<<<<
12505  * raise TypeError("Cannot assign to read-only memoryview")
12506  *
12507  */
12508  }
12509 
12510  /* "View.MemoryView":415
12511  * raise TypeError("Cannot assign to read-only memoryview")
12512  *
12513  * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
12514  *
12515  * if have_slices:
12516  */
12517  __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 415, __pyx_L1_error)
12518  __Pyx_GOTREF(__pyx_t_2);
12519  if (likely(__pyx_t_2 != Py_None)) {
12520  PyObject* sequence = __pyx_t_2;
12521  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
12522  if (unlikely(size != 2)) {
12523  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
12524  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
12525  __PYX_ERR(1, 415, __pyx_L1_error)
12526  }
12527  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12528  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
12529  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
12530  __Pyx_INCREF(__pyx_t_3);
12531  __Pyx_INCREF(__pyx_t_4);
12532  #else
12533  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 415, __pyx_L1_error)
12534  __Pyx_GOTREF(__pyx_t_3);
12535  __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 415, __pyx_L1_error)
12536  __Pyx_GOTREF(__pyx_t_4);
12537  #endif
12538  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12539  } else {
12540  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 415, __pyx_L1_error)
12541  }
12542  __pyx_v_have_slices = __pyx_t_3;
12543  __pyx_t_3 = 0;
12544  __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
12545  __pyx_t_4 = 0;
12546 
12547  /* "View.MemoryView":417
12548  * have_slices, index = _unellipsify(index, self.view.ndim)
12549  *
12550  * if have_slices: # <<<<<<<<<<<<<<
12551  * obj = self.is_slice(value)
12552  * if obj:
12553  */
12554  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 417, __pyx_L1_error)
12555  if (__pyx_t_1) {
12556 
12557  /* "View.MemoryView":418
12558  *
12559  * if have_slices:
12560  * obj = self.is_slice(value) # <<<<<<<<<<<<<<
12561  * if obj:
12562  * self.setitem_slice_assignment(self[index], obj)
12563  */
12564  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error)
12565  __Pyx_GOTREF(__pyx_t_2);
12566  __pyx_v_obj = __pyx_t_2;
12567  __pyx_t_2 = 0;
12568 
12569  /* "View.MemoryView":419
12570  * if have_slices:
12571  * obj = self.is_slice(value)
12572  * if obj: # <<<<<<<<<<<<<<
12573  * self.setitem_slice_assignment(self[index], obj)
12574  * else:
12575  */
12576  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 419, __pyx_L1_error)
12577  if (__pyx_t_1) {
12578 
12579  /* "View.MemoryView":420
12580  * obj = self.is_slice(value)
12581  * if obj:
12582  * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
12583  * else:
12584  * self.setitem_slice_assign_scalar(self[index], value)
12585  */
12586  __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 420, __pyx_L1_error)
12587  __Pyx_GOTREF(__pyx_t_2);
12588  __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 420, __pyx_L1_error)
12589  __Pyx_GOTREF(__pyx_t_4);
12590  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12591  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12592 
12593  /* "View.MemoryView":419
12594  * if have_slices:
12595  * obj = self.is_slice(value)
12596  * if obj: # <<<<<<<<<<<<<<
12597  * self.setitem_slice_assignment(self[index], obj)
12598  * else:
12599  */
12600  goto __pyx_L5;
12601  }
12602 
12603  /* "View.MemoryView":422
12604  * self.setitem_slice_assignment(self[index], obj)
12605  * else:
12606  * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
12607  * else:
12608  * self.setitem_indexed(index, value)
12609  */
12610  /*else*/ {
12611  __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 422, __pyx_L1_error)
12612  __Pyx_GOTREF(__pyx_t_4);
12613  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 422, __pyx_L1_error)
12614  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 422, __pyx_L1_error)
12615  __Pyx_GOTREF(__pyx_t_2);
12616  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12617  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12618  }
12619  __pyx_L5:;
12620 
12621  /* "View.MemoryView":417
12622  * have_slices, index = _unellipsify(index, self.view.ndim)
12623  *
12624  * if have_slices: # <<<<<<<<<<<<<<
12625  * obj = self.is_slice(value)
12626  * if obj:
12627  */
12628  goto __pyx_L4;
12629  }
12630 
12631  /* "View.MemoryView":424
12632  * self.setitem_slice_assign_scalar(self[index], value)
12633  * else:
12634  * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
12635  *
12636  * cdef is_slice(self, obj):
12637  */
12638  /*else*/ {
12639  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 424, __pyx_L1_error)
12640  __Pyx_GOTREF(__pyx_t_2);
12641  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12642  }
12643  __pyx_L4:;
12644 
12645  /* "View.MemoryView":411
12646  * return self.convert_item_to_object(itemp)
12647  *
12648  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
12649  * if self.view.readonly:
12650  * raise TypeError("Cannot assign to read-only memoryview")
12651  */
12652 
12653  /* function exit code */
12654  __pyx_r = 0;
12655  goto __pyx_L0;
12656  __pyx_L1_error:;
12657  __Pyx_XDECREF(__pyx_t_2);
12658  __Pyx_XDECREF(__pyx_t_3);
12659  __Pyx_XDECREF(__pyx_t_4);
12660  __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12661  __pyx_r = -1;
12662  __pyx_L0:;
12663  __Pyx_XDECREF(__pyx_v_have_slices);
12664  __Pyx_XDECREF(__pyx_v_obj);
12665  __Pyx_XDECREF(__pyx_v_index);
12666  __Pyx_RefNannyFinishContext();
12667  return __pyx_r;
12668 }
12669 
12670 /* "View.MemoryView":426
12671  * self.setitem_indexed(index, value)
12672  *
12673  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
12674  * if not isinstance(obj, memoryview):
12675  * try:
12676  */
12677 
12678 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
12679  PyObject *__pyx_r = NULL;
12680  __Pyx_RefNannyDeclarations
12681  int __pyx_t_1;
12682  int __pyx_t_2;
12683  PyObject *__pyx_t_3 = NULL;
12684  PyObject *__pyx_t_4 = NULL;
12685  PyObject *__pyx_t_5 = NULL;
12686  PyObject *__pyx_t_6 = NULL;
12687  PyObject *__pyx_t_7 = NULL;
12688  PyObject *__pyx_t_8 = NULL;
12689  int __pyx_t_9;
12690  __Pyx_RefNannySetupContext("is_slice", 0);
12691  __Pyx_INCREF(__pyx_v_obj);
12692 
12693  /* "View.MemoryView":427
12694  *
12695  * cdef is_slice(self, obj):
12696  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
12697  * try:
12698  * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
12699  */
12700  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
12701  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
12702  if (__pyx_t_2) {
12703 
12704  /* "View.MemoryView":428
12705  * cdef is_slice(self, obj):
12706  * if not isinstance(obj, memoryview):
12707  * try: # <<<<<<<<<<<<<<
12708  * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
12709  * self.dtype_is_object)
12710  */
12711  {
12712  __Pyx_PyThreadState_declare
12713  __Pyx_PyThreadState_assign
12714  __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
12715  __Pyx_XGOTREF(__pyx_t_3);
12716  __Pyx_XGOTREF(__pyx_t_4);
12717  __Pyx_XGOTREF(__pyx_t_5);
12718  /*try:*/ {
12719 
12720  /* "View.MemoryView":429
12721  * if not isinstance(obj, memoryview):
12722  * try:
12723  * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
12724  * self.dtype_is_object)
12725  * except TypeError:
12726  */
12727  __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 429, __pyx_L4_error)
12728  __Pyx_GOTREF(__pyx_t_6);
12729 
12730  /* "View.MemoryView":430
12731  * try:
12732  * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
12733  * self.dtype_is_object) # <<<<<<<<<<<<<<
12734  * except TypeError:
12735  * return None
12736  */
12737  __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 430, __pyx_L4_error)
12738  __Pyx_GOTREF(__pyx_t_7);
12739 
12740  /* "View.MemoryView":429
12741  * if not isinstance(obj, memoryview):
12742  * try:
12743  * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
12744  * self.dtype_is_object)
12745  * except TypeError:
12746  */
12747  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 429, __pyx_L4_error)
12748  __Pyx_GOTREF(__pyx_t_8);
12749  __Pyx_INCREF(__pyx_v_obj);
12750  __Pyx_GIVEREF(__pyx_v_obj);
12751  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
12752  __Pyx_GIVEREF(__pyx_t_6);
12753  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
12754  __Pyx_GIVEREF(__pyx_t_7);
12755  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
12756  __pyx_t_6 = 0;
12757  __pyx_t_7 = 0;
12758  __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 429, __pyx_L4_error)
12759  __Pyx_GOTREF(__pyx_t_7);
12760  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12761  __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
12762  __pyx_t_7 = 0;
12763 
12764  /* "View.MemoryView":428
12765  * cdef is_slice(self, obj):
12766  * if not isinstance(obj, memoryview):
12767  * try: # <<<<<<<<<<<<<<
12768  * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
12769  * self.dtype_is_object)
12770  */
12771  }
12772  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12773  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12774  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12775  goto __pyx_L9_try_end;
12776  __pyx_L4_error:;
12777  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12778  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
12779  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12780 
12781  /* "View.MemoryView":431
12782  * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
12783  * self.dtype_is_object)
12784  * except TypeError: # <<<<<<<<<<<<<<
12785  * return None
12786  *
12787  */
12788  __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
12789  if (__pyx_t_9) {
12790  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
12791  if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 431, __pyx_L6_except_error)
12792  __Pyx_GOTREF(__pyx_t_7);
12793  __Pyx_GOTREF(__pyx_t_8);
12794  __Pyx_GOTREF(__pyx_t_6);
12795 
12796  /* "View.MemoryView":432
12797  * self.dtype_is_object)
12798  * except TypeError:
12799  * return None # <<<<<<<<<<<<<<
12800  *
12801  * return obj
12802  */
12803  __Pyx_XDECREF(__pyx_r);
12804  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12805  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12806  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12807  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12808  goto __pyx_L7_except_return;
12809  }
12810  goto __pyx_L6_except_error;
12811  __pyx_L6_except_error:;
12812 
12813  /* "View.MemoryView":428
12814  * cdef is_slice(self, obj):
12815  * if not isinstance(obj, memoryview):
12816  * try: # <<<<<<<<<<<<<<
12817  * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
12818  * self.dtype_is_object)
12819  */
12820  __Pyx_XGIVEREF(__pyx_t_3);
12821  __Pyx_XGIVEREF(__pyx_t_4);
12822  __Pyx_XGIVEREF(__pyx_t_5);
12823  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
12824  goto __pyx_L1_error;
12825  __pyx_L7_except_return:;
12826  __Pyx_XGIVEREF(__pyx_t_3);
12827  __Pyx_XGIVEREF(__pyx_t_4);
12828  __Pyx_XGIVEREF(__pyx_t_5);
12829  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
12830  goto __pyx_L0;
12831  __pyx_L9_try_end:;
12832  }
12833 
12834  /* "View.MemoryView":427
12835  *
12836  * cdef is_slice(self, obj):
12837  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
12838  * try:
12839  * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
12840  */
12841  }
12842 
12843  /* "View.MemoryView":434
12844  * return None
12845  *
12846  * return obj # <<<<<<<<<<<<<<
12847  *
12848  * cdef setitem_slice_assignment(self, dst, src):
12849  */
12850  __Pyx_XDECREF(__pyx_r);
12851  __Pyx_INCREF(__pyx_v_obj);
12852  __pyx_r = __pyx_v_obj;
12853  goto __pyx_L0;
12854 
12855  /* "View.MemoryView":426
12856  * self.setitem_indexed(index, value)
12857  *
12858  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
12859  * if not isinstance(obj, memoryview):
12860  * try:
12861  */
12862 
12863  /* function exit code */
12864  __pyx_L1_error:;
12865  __Pyx_XDECREF(__pyx_t_6);
12866  __Pyx_XDECREF(__pyx_t_7);
12867  __Pyx_XDECREF(__pyx_t_8);
12868  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
12869  __pyx_r = 0;
12870  __pyx_L0:;
12871  __Pyx_XDECREF(__pyx_v_obj);
12872  __Pyx_XGIVEREF(__pyx_r);
12873  __Pyx_RefNannyFinishContext();
12874  return __pyx_r;
12875 }
12876 
12877 /* "View.MemoryView":436
12878  * return obj
12879  *
12880  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
12881  * cdef __Pyx_memviewslice dst_slice
12882  * cdef __Pyx_memviewslice src_slice
12883  */
12884 
12885 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
12886  __Pyx_memviewslice __pyx_v_dst_slice;
12887  __Pyx_memviewslice __pyx_v_src_slice;
12888  PyObject *__pyx_r = NULL;
12889  __Pyx_RefNannyDeclarations
12890  PyObject *__pyx_t_1 = NULL;
12891  int __pyx_t_2;
12892  int __pyx_t_3;
12893  int __pyx_t_4;
12894  __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
12895 
12896  /* "View.MemoryView":440
12897  * cdef __Pyx_memviewslice src_slice
12898  *
12899  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
12900  * get_slice_from_memview(dst, &dst_slice)[0],
12901  * src.ndim, dst.ndim, self.dtype_is_object)
12902  */
12903  if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 440, __pyx_L1_error)
12904 
12905  /* "View.MemoryView":441
12906  *
12907  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
12908  * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<<
12909  * src.ndim, dst.ndim, self.dtype_is_object)
12910  *
12911  */
12912  if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 441, __pyx_L1_error)
12913 
12914  /* "View.MemoryView":442
12915  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
12916  * get_slice_from_memview(dst, &dst_slice)[0],
12917  * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
12918  *
12919  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
12920  */
12921  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 442, __pyx_L1_error)
12922  __Pyx_GOTREF(__pyx_t_1);
12923  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 442, __pyx_L1_error)
12924  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12925  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 442, __pyx_L1_error)
12926  __Pyx_GOTREF(__pyx_t_1);
12927  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 442, __pyx_L1_error)
12928  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12929 
12930  /* "View.MemoryView":440
12931  * cdef __Pyx_memviewslice src_slice
12932  *
12933  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
12934  * get_slice_from_memview(dst, &dst_slice)[0],
12935  * src.ndim, dst.ndim, self.dtype_is_object)
12936  */
12937  __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 440, __pyx_L1_error)
12938 
12939  /* "View.MemoryView":436
12940  * return obj
12941  *
12942  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
12943  * cdef __Pyx_memviewslice dst_slice
12944  * cdef __Pyx_memviewslice src_slice
12945  */
12946 
12947  /* function exit code */
12948  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12949  goto __pyx_L0;
12950  __pyx_L1_error:;
12951  __Pyx_XDECREF(__pyx_t_1);
12952  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
12953  __pyx_r = 0;
12954  __pyx_L0:;
12955  __Pyx_XGIVEREF(__pyx_r);
12956  __Pyx_RefNannyFinishContext();
12957  return __pyx_r;
12958 }
12959 
12960 /* "View.MemoryView":444
12961  * src.ndim, dst.ndim, self.dtype_is_object)
12962  *
12963  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
12964  * cdef int array[128]
12965  * cdef void *tmp = NULL
12966  */
12967 
12968 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
12969  int __pyx_v_array[0x80];
12970  void *__pyx_v_tmp;
12971  void *__pyx_v_item;
12972  __Pyx_memviewslice *__pyx_v_dst_slice;
12973  __Pyx_memviewslice __pyx_v_tmp_slice;
12974  PyObject *__pyx_r = NULL;
12975  __Pyx_RefNannyDeclarations
12976  int __pyx_t_1;
12977  PyObject *__pyx_t_2 = NULL;
12978  int __pyx_t_3;
12979  int __pyx_t_4;
12980  char const *__pyx_t_5;
12981  PyObject *__pyx_t_6 = NULL;
12982  PyObject *__pyx_t_7 = NULL;
12983  PyObject *__pyx_t_8 = NULL;
12984  PyObject *__pyx_t_9 = NULL;
12985  PyObject *__pyx_t_10 = NULL;
12986  PyObject *__pyx_t_11 = NULL;
12987  __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
12988 
12989  /* "View.MemoryView":446
12990  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
12991  * cdef int array[128]
12992  * cdef void *tmp = NULL # <<<<<<<<<<<<<<
12993  * cdef void *item
12994  *
12995  */
12996  __pyx_v_tmp = NULL;
12997 
12998  /* "View.MemoryView":451
12999  * cdef __Pyx_memviewslice *dst_slice
13000  * cdef __Pyx_memviewslice tmp_slice
13001  * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
13002  *
13003  * if <size_t>self.view.itemsize > sizeof(array):
13004  */
13005  __pyx_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
13006 
13007  /* "View.MemoryView":453
13008  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
13009  *
13010  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
13011  * tmp = PyMem_Malloc(self.view.itemsize)
13012  * if tmp == NULL:
13013  */
13014  __pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
13015  if (__pyx_t_1) {
13016 
13017  /* "View.MemoryView":454
13018  *
13019  * if <size_t>self.view.itemsize > sizeof(array):
13020  * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
13021  * if tmp == NULL:
13022  * raise MemoryError
13023  */
13024  __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
13025 
13026  /* "View.MemoryView":455
13027  * if <size_t>self.view.itemsize > sizeof(array):
13028  * tmp = PyMem_Malloc(self.view.itemsize)
13029  * if tmp == NULL: # <<<<<<<<<<<<<<
13030  * raise MemoryError
13031  * item = tmp
13032  */
13033  __pyx_t_1 = ((__pyx_v_tmp == NULL) != 0);
13034  if (unlikely(__pyx_t_1)) {
13035 
13036  /* "View.MemoryView":456
13037  * tmp = PyMem_Malloc(self.view.itemsize)
13038  * if tmp == NULL:
13039  * raise MemoryError # <<<<<<<<<<<<<<
13040  * item = tmp
13041  * else:
13042  */
13043  PyErr_NoMemory(); __PYX_ERR(1, 456, __pyx_L1_error)
13044 
13045  /* "View.MemoryView":455
13046  * if <size_t>self.view.itemsize > sizeof(array):
13047  * tmp = PyMem_Malloc(self.view.itemsize)
13048  * if tmp == NULL: # <<<<<<<<<<<<<<
13049  * raise MemoryError
13050  * item = tmp
13051  */
13052  }
13053 
13054  /* "View.MemoryView":457
13055  * if tmp == NULL:
13056  * raise MemoryError
13057  * item = tmp # <<<<<<<<<<<<<<
13058  * else:
13059  * item = <void *> array
13060  */
13061  __pyx_v_item = __pyx_v_tmp;
13062 
13063  /* "View.MemoryView":453
13064  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
13065  *
13066  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
13067  * tmp = PyMem_Malloc(self.view.itemsize)
13068  * if tmp == NULL:
13069  */
13070  goto __pyx_L3;
13071  }
13072 
13073  /* "View.MemoryView":459
13074  * item = tmp
13075  * else:
13076  * item = <void *> array # <<<<<<<<<<<<<<
13077  *
13078  * try:
13079  */
13080  /*else*/ {
13081  __pyx_v_item = ((void *)__pyx_v_array);
13082  }
13083  __pyx_L3:;
13084 
13085  /* "View.MemoryView":461
13086  * item = <void *> array
13087  *
13088  * try: # <<<<<<<<<<<<<<
13089  * if self.dtype_is_object:
13090  * (<PyObject **> item)[0] = <PyObject *> value
13091  */
13092  /*try:*/ {
13093 
13094  /* "View.MemoryView":462
13095  *
13096  * try:
13097  * if self.dtype_is_object: # <<<<<<<<<<<<<<
13098  * (<PyObject **> item)[0] = <PyObject *> value
13099  * else:
13100  */
13101  __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
13102  if (__pyx_t_1) {
13103 
13104  /* "View.MemoryView":463
13105  * try:
13106  * if self.dtype_is_object:
13107  * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
13108  * else:
13109  * self.assign_item_from_object(<char *> item, value)
13110  */
13111  (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
13112 
13113  /* "View.MemoryView":462
13114  *
13115  * try:
13116  * if self.dtype_is_object: # <<<<<<<<<<<<<<
13117  * (<PyObject **> item)[0] = <PyObject *> value
13118  * else:
13119  */
13120  goto __pyx_L8;
13121  }
13122 
13123  /* "View.MemoryView":465
13124  * (<PyObject **> item)[0] = <PyObject *> value
13125  * else:
13126  * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
13127  *
13128  *
13129  */
13130  /*else*/ {
13131  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 465, __pyx_L6_error)
13132  __Pyx_GOTREF(__pyx_t_2);
13133  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13134  }
13135  __pyx_L8:;
13136 
13137  /* "View.MemoryView":469
13138  *
13139  *
13140  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
13141  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
13142  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
13143  */
13144  __pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
13145  if (__pyx_t_1) {
13146 
13147  /* "View.MemoryView":470
13148  *
13149  * if self.view.suboffsets != NULL:
13150  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
13151  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
13152  * item, self.dtype_is_object)
13153  */
13154  __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 470, __pyx_L6_error)
13155  __Pyx_GOTREF(__pyx_t_2);
13156  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13157 
13158  /* "View.MemoryView":469
13159  *
13160  *
13161  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
13162  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
13163  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
13164  */
13165  }
13166 
13167  /* "View.MemoryView":471
13168  * if self.view.suboffsets != NULL:
13169  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
13170  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
13171  * item, self.dtype_is_object)
13172  * finally:
13173  */
13174  __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
13175  }
13176 
13177  /* "View.MemoryView":474
13178  * item, self.dtype_is_object)
13179  * finally:
13180  * PyMem_Free(tmp) # <<<<<<<<<<<<<<
13181  *
13182  * cdef setitem_indexed(self, index, value):
13183  */
13184  /*finally:*/ {
13185  /*normal exit:*/{
13186  PyMem_Free(__pyx_v_tmp);
13187  goto __pyx_L7;
13188  }
13189  __pyx_L6_error:;
13190  /*exception exit:*/{
13191  __Pyx_PyThreadState_declare
13192  __Pyx_PyThreadState_assign
13193  __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
13194  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
13195  if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
13196  if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
13197  __Pyx_XGOTREF(__pyx_t_6);
13198  __Pyx_XGOTREF(__pyx_t_7);
13199  __Pyx_XGOTREF(__pyx_t_8);
13200  __Pyx_XGOTREF(__pyx_t_9);
13201  __Pyx_XGOTREF(__pyx_t_10);
13202  __Pyx_XGOTREF(__pyx_t_11);
13203  __pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename;
13204  {
13205  PyMem_Free(__pyx_v_tmp);
13206  }
13207  if (PY_MAJOR_VERSION >= 3) {
13208  __Pyx_XGIVEREF(__pyx_t_9);
13209  __Pyx_XGIVEREF(__pyx_t_10);
13210  __Pyx_XGIVEREF(__pyx_t_11);
13211  __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
13212  }
13213  __Pyx_XGIVEREF(__pyx_t_6);
13214  __Pyx_XGIVEREF(__pyx_t_7);
13215  __Pyx_XGIVEREF(__pyx_t_8);
13216  __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
13217  __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
13218  __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5;
13219  goto __pyx_L1_error;
13220  }
13221  __pyx_L7:;
13222  }
13223 
13224  /* "View.MemoryView":444
13225  * src.ndim, dst.ndim, self.dtype_is_object)
13226  *
13227  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
13228  * cdef int array[128]
13229  * cdef void *tmp = NULL
13230  */
13231 
13232  /* function exit code */
13233  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13234  goto __pyx_L0;
13235  __pyx_L1_error:;
13236  __Pyx_XDECREF(__pyx_t_2);
13237  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
13238  __pyx_r = 0;
13239  __pyx_L0:;
13240  __Pyx_XGIVEREF(__pyx_r);
13241  __Pyx_RefNannyFinishContext();
13242  return __pyx_r;
13243 }
13244 
13245 /* "View.MemoryView":476
13246  * PyMem_Free(tmp)
13247  *
13248  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
13249  * cdef char *itemp = self.get_item_pointer(index)
13250  * self.assign_item_from_object(itemp, value)
13251  */
13252 
13253 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
13254  char *__pyx_v_itemp;
13255  PyObject *__pyx_r = NULL;
13256  __Pyx_RefNannyDeclarations
13257  char *__pyx_t_1;
13258  PyObject *__pyx_t_2 = NULL;
13259  __Pyx_RefNannySetupContext("setitem_indexed", 0);
13260 
13261  /* "View.MemoryView":477
13262  *
13263  * cdef setitem_indexed(self, index, value):
13264  * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
13265  * self.assign_item_from_object(itemp, value)
13266  *
13267  */
13268  __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(1, 477, __pyx_L1_error)
13269  __pyx_v_itemp = __pyx_t_1;
13270 
13271  /* "View.MemoryView":478
13272  * cdef setitem_indexed(self, index, value):
13273  * cdef char *itemp = self.get_item_pointer(index)
13274  * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
13275  *
13276  * cdef convert_item_to_object(self, char *itemp):
13277  */
13278  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 478, __pyx_L1_error)
13279  __Pyx_GOTREF(__pyx_t_2);
13280  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13281 
13282  /* "View.MemoryView":476
13283  * PyMem_Free(tmp)
13284  *
13285  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
13286  * cdef char *itemp = self.get_item_pointer(index)
13287  * self.assign_item_from_object(itemp, value)
13288  */
13289 
13290  /* function exit code */
13291  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13292  goto __pyx_L0;
13293  __pyx_L1_error:;
13294  __Pyx_XDECREF(__pyx_t_2);
13295  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
13296  __pyx_r = 0;
13297  __pyx_L0:;
13298  __Pyx_XGIVEREF(__pyx_r);
13299  __Pyx_RefNannyFinishContext();
13300  return __pyx_r;
13301 }
13302 
13303 /* "View.MemoryView":480
13304  * self.assign_item_from_object(itemp, value)
13305  *
13306  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
13307  * """Only used if instantiated manually by the user, or if Cython doesn't
13308  * know how to convert the type"""
13309  */
13310 
13311 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
13312  PyObject *__pyx_v_struct = NULL;
13313  PyObject *__pyx_v_bytesitem = 0;
13314  PyObject *__pyx_v_result = NULL;
13315  PyObject *__pyx_r = NULL;
13316  __Pyx_RefNannyDeclarations
13317  PyObject *__pyx_t_1 = NULL;
13318  PyObject *__pyx_t_2 = NULL;
13319  PyObject *__pyx_t_3 = NULL;
13320  PyObject *__pyx_t_4 = NULL;
13321  PyObject *__pyx_t_5 = NULL;
13322  PyObject *__pyx_t_6 = NULL;
13323  PyObject *__pyx_t_7 = NULL;
13324  int __pyx_t_8;
13325  PyObject *__pyx_t_9 = NULL;
13326  size_t __pyx_t_10;
13327  int __pyx_t_11;
13328  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
13329 
13330  /* "View.MemoryView":483
13331  * """Only used if instantiated manually by the user, or if Cython doesn't
13332  * know how to convert the type"""
13333  * import struct # <<<<<<<<<<<<<<
13334  * cdef bytes bytesitem
13335  *
13336  */
13337  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 483, __pyx_L1_error)
13338  __Pyx_GOTREF(__pyx_t_1);
13339  __pyx_v_struct = __pyx_t_1;
13340  __pyx_t_1 = 0;
13341 
13342  /* "View.MemoryView":486
13343  * cdef bytes bytesitem
13344  *
13345  * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
13346  * try:
13347  * result = struct.unpack(self.view.format, bytesitem)
13348  */
13349  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 486, __pyx_L1_error)
13350  __Pyx_GOTREF(__pyx_t_1);
13351  __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
13352  __pyx_t_1 = 0;
13353 
13354  /* "View.MemoryView":487
13355  *
13356  * bytesitem = itemp[:self.view.itemsize]
13357  * try: # <<<<<<<<<<<<<<
13358  * result = struct.unpack(self.view.format, bytesitem)
13359  * except struct.error:
13360  */
13361  {
13362  __Pyx_PyThreadState_declare
13363  __Pyx_PyThreadState_assign
13364  __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
13365  __Pyx_XGOTREF(__pyx_t_2);
13366  __Pyx_XGOTREF(__pyx_t_3);
13367  __Pyx_XGOTREF(__pyx_t_4);
13368  /*try:*/ {
13369 
13370  /* "View.MemoryView":488
13371  * bytesitem = itemp[:self.view.itemsize]
13372  * try:
13373  * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
13374  * except struct.error:
13375  * raise ValueError("Unable to convert item to object")
13376  */
13377  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 488, __pyx_L3_error)
13378  __Pyx_GOTREF(__pyx_t_5);
13379  __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 488, __pyx_L3_error)
13380  __Pyx_GOTREF(__pyx_t_6);
13381  __pyx_t_7 = NULL;
13382  __pyx_t_8 = 0;
13383  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
13384  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
13385  if (likely(__pyx_t_7)) {
13386  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
13387  __Pyx_INCREF(__pyx_t_7);
13388  __Pyx_INCREF(function);
13389  __Pyx_DECREF_SET(__pyx_t_5, function);
13390  __pyx_t_8 = 1;
13391  }
13392  }
13393  #if CYTHON_FAST_PYCALL
13394  if (PyFunction_Check(__pyx_t_5)) {
13395  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
13396  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L3_error)
13397  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
13398  __Pyx_GOTREF(__pyx_t_1);
13399  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13400  } else
13401  #endif
13402  #if CYTHON_FAST_PYCCALL
13403  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
13404  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
13405  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L3_error)
13406  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
13407  __Pyx_GOTREF(__pyx_t_1);
13408  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13409  } else
13410  #endif
13411  {
13412  __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 488, __pyx_L3_error)
13413  __Pyx_GOTREF(__pyx_t_9);
13414  if (__pyx_t_7) {
13415  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
13416  }
13417  __Pyx_GIVEREF(__pyx_t_6);
13418  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
13419  __Pyx_INCREF(__pyx_v_bytesitem);
13420  __Pyx_GIVEREF(__pyx_v_bytesitem);
13421  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
13422  __pyx_t_6 = 0;
13423  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L3_error)
13424  __Pyx_GOTREF(__pyx_t_1);
13425  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13426  }
13427  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13428  __pyx_v_result = __pyx_t_1;
13429  __pyx_t_1 = 0;
13430 
13431  /* "View.MemoryView":487
13432  *
13433  * bytesitem = itemp[:self.view.itemsize]
13434  * try: # <<<<<<<<<<<<<<
13435  * result = struct.unpack(self.view.format, bytesitem)
13436  * except struct.error:
13437  */
13438  }
13439 
13440  /* "View.MemoryView":492
13441  * raise ValueError("Unable to convert item to object")
13442  * else:
13443  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
13444  * return result[0]
13445  * return result
13446  */
13447  /*else:*/ {
13448  __pyx_t_10 = strlen(__pyx_v_self->view.format);
13449  __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
13450  if (__pyx_t_11) {
13451 
13452  /* "View.MemoryView":493
13453  * else:
13454  * if len(self.view.format) == 1:
13455  * return result[0] # <<<<<<<<<<<<<<
13456  * return result
13457  *
13458  */
13459  __Pyx_XDECREF(__pyx_r);
13460  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L5_except_error)
13461  __Pyx_GOTREF(__pyx_t_1);
13462  __pyx_r = __pyx_t_1;
13463  __pyx_t_1 = 0;
13464  goto __pyx_L6_except_return;
13465 
13466  /* "View.MemoryView":492
13467  * raise ValueError("Unable to convert item to object")
13468  * else:
13469  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
13470  * return result[0]
13471  * return result
13472  */
13473  }
13474 
13475  /* "View.MemoryView":494
13476  * if len(self.view.format) == 1:
13477  * return result[0]
13478  * return result # <<<<<<<<<<<<<<
13479  *
13480  * cdef assign_item_from_object(self, char *itemp, object value):
13481  */
13482  __Pyx_XDECREF(__pyx_r);
13483  __Pyx_INCREF(__pyx_v_result);
13484  __pyx_r = __pyx_v_result;
13485  goto __pyx_L6_except_return;
13486  }
13487  __pyx_L3_error:;
13488  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
13489  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
13490  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
13491  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13492  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
13493 
13494  /* "View.MemoryView":489
13495  * try:
13496  * result = struct.unpack(self.view.format, bytesitem)
13497  * except struct.error: # <<<<<<<<<<<<<<
13498  * raise ValueError("Unable to convert item to object")
13499  * else:
13500  */
13501  __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
13502  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 489, __pyx_L5_except_error)
13503  __Pyx_GOTREF(__pyx_t_6);
13504  __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
13505  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13506  __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
13507  __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
13508  if (__pyx_t_8) {
13509  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
13510  if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 489, __pyx_L5_except_error)
13511  __Pyx_GOTREF(__pyx_t_9);
13512  __Pyx_GOTREF(__pyx_t_5);
13513  __Pyx_GOTREF(__pyx_t_1);
13514 
13515  /* "View.MemoryView":490
13516  * result = struct.unpack(self.view.format, bytesitem)
13517  * except struct.error:
13518  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
13519  * else:
13520  * if len(self.view.format) == 1:
13521  */
13522  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 490, __pyx_L5_except_error)
13523  __Pyx_GOTREF(__pyx_t_6);
13524  __Pyx_Raise(__pyx_t_6, 0, 0, 0);
13525  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13526  __PYX_ERR(1, 490, __pyx_L5_except_error)
13527  }
13528  goto __pyx_L5_except_error;
13529  __pyx_L5_except_error:;
13530 
13531  /* "View.MemoryView":487
13532  *
13533  * bytesitem = itemp[:self.view.itemsize]
13534  * try: # <<<<<<<<<<<<<<
13535  * result = struct.unpack(self.view.format, bytesitem)
13536  * except struct.error:
13537  */
13538  __Pyx_XGIVEREF(__pyx_t_2);
13539  __Pyx_XGIVEREF(__pyx_t_3);
13540  __Pyx_XGIVEREF(__pyx_t_4);
13541  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
13542  goto __pyx_L1_error;
13543  __pyx_L6_except_return:;
13544  __Pyx_XGIVEREF(__pyx_t_2);
13545  __Pyx_XGIVEREF(__pyx_t_3);
13546  __Pyx_XGIVEREF(__pyx_t_4);
13547  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
13548  goto __pyx_L0;
13549  }
13550 
13551  /* "View.MemoryView":480
13552  * self.assign_item_from_object(itemp, value)
13553  *
13554  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
13555  * """Only used if instantiated manually by the user, or if Cython doesn't
13556  * know how to convert the type"""
13557  */
13558 
13559  /* function exit code */
13560  __pyx_L1_error:;
13561  __Pyx_XDECREF(__pyx_t_1);
13562  __Pyx_XDECREF(__pyx_t_5);
13563  __Pyx_XDECREF(__pyx_t_6);
13564  __Pyx_XDECREF(__pyx_t_7);
13565  __Pyx_XDECREF(__pyx_t_9);
13566  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
13567  __pyx_r = 0;
13568  __pyx_L0:;
13569  __Pyx_XDECREF(__pyx_v_struct);
13570  __Pyx_XDECREF(__pyx_v_bytesitem);
13571  __Pyx_XDECREF(__pyx_v_result);
13572  __Pyx_XGIVEREF(__pyx_r);
13573  __Pyx_RefNannyFinishContext();
13574  return __pyx_r;
13575 }
13576 
13577 /* "View.MemoryView":496
13578  * return result
13579  *
13580  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
13581  * """Only used if instantiated manually by the user, or if Cython doesn't
13582  * know how to convert the type"""
13583  */
13584 
13585 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
13586  PyObject *__pyx_v_struct = NULL;
13587  char __pyx_v_c;
13588  PyObject *__pyx_v_bytesvalue = 0;
13589  Py_ssize_t __pyx_v_i;
13590  PyObject *__pyx_r = NULL;
13591  __Pyx_RefNannyDeclarations
13592  PyObject *__pyx_t_1 = NULL;
13593  int __pyx_t_2;
13594  int __pyx_t_3;
13595  PyObject *__pyx_t_4 = NULL;
13596  PyObject *__pyx_t_5 = NULL;
13597  PyObject *__pyx_t_6 = NULL;
13598  int __pyx_t_7;
13599  PyObject *__pyx_t_8 = NULL;
13600  Py_ssize_t __pyx_t_9;
13601  PyObject *__pyx_t_10 = NULL;
13602  char *__pyx_t_11;
13603  char *__pyx_t_12;
13604  char *__pyx_t_13;
13605  char *__pyx_t_14;
13606  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
13607 
13608  /* "View.MemoryView":499
13609  * """Only used if instantiated manually by the user, or if Cython doesn't
13610  * know how to convert the type"""
13611  * import struct # <<<<<<<<<<<<<<
13612  * cdef char c
13613  * cdef bytes bytesvalue
13614  */
13615  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 499, __pyx_L1_error)
13616  __Pyx_GOTREF(__pyx_t_1);
13617  __pyx_v_struct = __pyx_t_1;
13618  __pyx_t_1 = 0;
13619 
13620  /* "View.MemoryView":504
13621  * cdef Py_ssize_t i
13622  *
13623  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
13624  * bytesvalue = struct.pack(self.view.format, *value)
13625  * else:
13626  */
13627  __pyx_t_2 = PyTuple_Check(__pyx_v_value);
13628  __pyx_t_3 = (__pyx_t_2 != 0);
13629  if (__pyx_t_3) {
13630 
13631  /* "View.MemoryView":505
13632  *
13633  * if isinstance(value, tuple):
13634  * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
13635  * else:
13636  * bytesvalue = struct.pack(self.view.format, value)
13637  */
13638  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 505, __pyx_L1_error)
13639  __Pyx_GOTREF(__pyx_t_1);
13640  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 505, __pyx_L1_error)
13641  __Pyx_GOTREF(__pyx_t_4);
13642  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 505, __pyx_L1_error)
13643  __Pyx_GOTREF(__pyx_t_5);
13644  __Pyx_GIVEREF(__pyx_t_4);
13645  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
13646  __pyx_t_4 = 0;
13647  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 505, __pyx_L1_error)
13648  __Pyx_GOTREF(__pyx_t_4);
13649  __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 505, __pyx_L1_error)
13650  __Pyx_GOTREF(__pyx_t_6);
13651  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13652  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13653  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 505, __pyx_L1_error)
13654  __Pyx_GOTREF(__pyx_t_4);
13655  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13656  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13657  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 505, __pyx_L1_error)
13658  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
13659  __pyx_t_4 = 0;
13660 
13661  /* "View.MemoryView":504
13662  * cdef Py_ssize_t i
13663  *
13664  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
13665  * bytesvalue = struct.pack(self.view.format, *value)
13666  * else:
13667  */
13668  goto __pyx_L3;
13669  }
13670 
13671  /* "View.MemoryView":507
13672  * bytesvalue = struct.pack(self.view.format, *value)
13673  * else:
13674  * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
13675  *
13676  * for i, c in enumerate(bytesvalue):
13677  */
13678  /*else*/ {
13679  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 507, __pyx_L1_error)
13680  __Pyx_GOTREF(__pyx_t_6);
13681  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 507, __pyx_L1_error)
13682  __Pyx_GOTREF(__pyx_t_1);
13683  __pyx_t_5 = NULL;
13684  __pyx_t_7 = 0;
13685  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
13686  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
13687  if (likely(__pyx_t_5)) {
13688  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
13689  __Pyx_INCREF(__pyx_t_5);
13690  __Pyx_INCREF(function);
13691  __Pyx_DECREF_SET(__pyx_t_6, function);
13692  __pyx_t_7 = 1;
13693  }
13694  }
13695  #if CYTHON_FAST_PYCALL
13696  if (PyFunction_Check(__pyx_t_6)) {
13697  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
13698  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 507, __pyx_L1_error)
13699  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13700  __Pyx_GOTREF(__pyx_t_4);
13701  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13702  } else
13703  #endif
13704  #if CYTHON_FAST_PYCCALL
13705  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
13706  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
13707  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 507, __pyx_L1_error)
13708  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13709  __Pyx_GOTREF(__pyx_t_4);
13710  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13711  } else
13712  #endif
13713  {
13714  __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 507, __pyx_L1_error)
13715  __Pyx_GOTREF(__pyx_t_8);
13716  if (__pyx_t_5) {
13717  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
13718  }
13719  __Pyx_GIVEREF(__pyx_t_1);
13720  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
13721  __Pyx_INCREF(__pyx_v_value);
13722  __Pyx_GIVEREF(__pyx_v_value);
13723  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
13724  __pyx_t_1 = 0;
13725  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 507, __pyx_L1_error)
13726  __Pyx_GOTREF(__pyx_t_4);
13727  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13728  }
13729  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13730  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 507, __pyx_L1_error)
13731  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
13732  __pyx_t_4 = 0;
13733  }
13734  __pyx_L3:;
13735 
13736  /* "View.MemoryView":509
13737  * bytesvalue = struct.pack(self.view.format, value)
13738  *
13739  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
13740  * itemp[i] = c
13741  *
13742  */
13743  __pyx_t_9 = 0;
13744  if (unlikely(__pyx_v_bytesvalue == Py_None)) {
13745  PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
13746  __PYX_ERR(1, 509, __pyx_L1_error)
13747  }
13748  __Pyx_INCREF(__pyx_v_bytesvalue);
13749  __pyx_t_10 = __pyx_v_bytesvalue;
13750  __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
13751  __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
13752  for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
13753  __pyx_t_11 = __pyx_t_14;
13754  __pyx_v_c = (__pyx_t_11[0]);
13755 
13756  /* "View.MemoryView":510
13757  *
13758  * for i, c in enumerate(bytesvalue):
13759  * itemp[i] = c # <<<<<<<<<<<<<<
13760  *
13761  * @cname('getbuffer')
13762  */
13763  __pyx_v_i = __pyx_t_9;
13764 
13765  /* "View.MemoryView":509
13766  * bytesvalue = struct.pack(self.view.format, value)
13767  *
13768  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
13769  * itemp[i] = c
13770  *
13771  */
13772  __pyx_t_9 = (__pyx_t_9 + 1);
13773 
13774  /* "View.MemoryView":510
13775  *
13776  * for i, c in enumerate(bytesvalue):
13777  * itemp[i] = c # <<<<<<<<<<<<<<
13778  *
13779  * @cname('getbuffer')
13780  */
13781  (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
13782  }
13783  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13784 
13785  /* "View.MemoryView":496
13786  * return result
13787  *
13788  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
13789  * """Only used if instantiated manually by the user, or if Cython doesn't
13790  * know how to convert the type"""
13791  */
13792 
13793  /* function exit code */
13794  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13795  goto __pyx_L0;
13796  __pyx_L1_error:;
13797  __Pyx_XDECREF(__pyx_t_1);
13798  __Pyx_XDECREF(__pyx_t_4);
13799  __Pyx_XDECREF(__pyx_t_5);
13800  __Pyx_XDECREF(__pyx_t_6);
13801  __Pyx_XDECREF(__pyx_t_8);
13802  __Pyx_XDECREF(__pyx_t_10);
13803  __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
13804  __pyx_r = 0;
13805  __pyx_L0:;
13806  __Pyx_XDECREF(__pyx_v_struct);
13807  __Pyx_XDECREF(__pyx_v_bytesvalue);
13808  __Pyx_XGIVEREF(__pyx_r);
13809  __Pyx_RefNannyFinishContext();
13810  return __pyx_r;
13811 }
13812 
13813 /* "View.MemoryView":513
13814  *
13815  * @cname('getbuffer')
13816  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
13817  * if flags & PyBUF_WRITABLE and self.view.readonly:
13818  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13819  */
13820 
13821 /* Python wrapper */
13822 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
13823 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
13824  int __pyx_r;
13825  __Pyx_RefNannyDeclarations
13826  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
13827  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
13828 
13829  /* function exit code */
13830  __Pyx_RefNannyFinishContext();
13831  return __pyx_r;
13832 }
13833 
13834 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
13835  int __pyx_r;
13836  __Pyx_RefNannyDeclarations
13837  int __pyx_t_1;
13838  int __pyx_t_2;
13839  PyObject *__pyx_t_3 = NULL;
13840  Py_ssize_t *__pyx_t_4;
13841  char *__pyx_t_5;
13842  void *__pyx_t_6;
13843  int __pyx_t_7;
13844  Py_ssize_t __pyx_t_8;
13845  if (__pyx_v_info == NULL) {
13846  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
13847  return -1;
13848  }
13849  __Pyx_RefNannySetupContext("__getbuffer__", 0);
13850  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
13851  __Pyx_GIVEREF(__pyx_v_info->obj);
13852 
13853  /* "View.MemoryView":514
13854  * @cname('getbuffer')
13855  * def __getbuffer__(self, Py_buffer *info, int flags):
13856  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
13857  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13858  *
13859  */
13860  __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
13861  if (__pyx_t_2) {
13862  } else {
13863  __pyx_t_1 = __pyx_t_2;
13864  goto __pyx_L4_bool_binop_done;
13865  }
13866  __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
13867  __pyx_t_1 = __pyx_t_2;
13868  __pyx_L4_bool_binop_done:;
13869  if (unlikely(__pyx_t_1)) {
13870 
13871  /* "View.MemoryView":515
13872  * def __getbuffer__(self, Py_buffer *info, int flags):
13873  * if flags & PyBUF_WRITABLE and self.view.readonly:
13874  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
13875  *
13876  * if flags & PyBUF_STRIDES:
13877  */
13878  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 515, __pyx_L1_error)
13879  __Pyx_GOTREF(__pyx_t_3);
13880  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
13881  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13882  __PYX_ERR(1, 515, __pyx_L1_error)
13883 
13884  /* "View.MemoryView":514
13885  * @cname('getbuffer')
13886  * def __getbuffer__(self, Py_buffer *info, int flags):
13887  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
13888  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13889  *
13890  */
13891  }
13892 
13893  /* "View.MemoryView":517
13894  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13895  *
13896  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
13897  * info.shape = self.view.shape
13898  * else:
13899  */
13900  __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
13901  if (__pyx_t_1) {
13902 
13903  /* "View.MemoryView":518
13904  *
13905  * if flags & PyBUF_STRIDES:
13906  * info.shape = self.view.shape # <<<<<<<<<<<<<<
13907  * else:
13908  * info.shape = NULL
13909  */
13910  __pyx_t_4 = __pyx_v_self->view.shape;
13911  __pyx_v_info->shape = __pyx_t_4;
13912 
13913  /* "View.MemoryView":517
13914  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13915  *
13916  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
13917  * info.shape = self.view.shape
13918  * else:
13919  */
13920  goto __pyx_L6;
13921  }
13922 
13923  /* "View.MemoryView":520
13924  * info.shape = self.view.shape
13925  * else:
13926  * info.shape = NULL # <<<<<<<<<<<<<<
13927  *
13928  * if flags & PyBUF_STRIDES:
13929  */
13930  /*else*/ {
13931  __pyx_v_info->shape = NULL;
13932  }
13933  __pyx_L6:;
13934 
13935  /* "View.MemoryView":522
13936  * info.shape = NULL
13937  *
13938  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
13939  * info.strides = self.view.strides
13940  * else:
13941  */
13942  __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
13943  if (__pyx_t_1) {
13944 
13945  /* "View.MemoryView":523
13946  *
13947  * if flags & PyBUF_STRIDES:
13948  * info.strides = self.view.strides # <<<<<<<<<<<<<<
13949  * else:
13950  * info.strides = NULL
13951  */
13952  __pyx_t_4 = __pyx_v_self->view.strides;
13953  __pyx_v_info->strides = __pyx_t_4;
13954 
13955  /* "View.MemoryView":522
13956  * info.shape = NULL
13957  *
13958  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
13959  * info.strides = self.view.strides
13960  * else:
13961  */
13962  goto __pyx_L7;
13963  }
13964 
13965  /* "View.MemoryView":525
13966  * info.strides = self.view.strides
13967  * else:
13968  * info.strides = NULL # <<<<<<<<<<<<<<
13969  *
13970  * if flags & PyBUF_INDIRECT:
13971  */
13972  /*else*/ {
13973  __pyx_v_info->strides = NULL;
13974  }
13975  __pyx_L7:;
13976 
13977  /* "View.MemoryView":527
13978  * info.strides = NULL
13979  *
13980  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
13981  * info.suboffsets = self.view.suboffsets
13982  * else:
13983  */
13984  __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
13985  if (__pyx_t_1) {
13986 
13987  /* "View.MemoryView":528
13988  *
13989  * if flags & PyBUF_INDIRECT:
13990  * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
13991  * else:
13992  * info.suboffsets = NULL
13993  */
13994  __pyx_t_4 = __pyx_v_self->view.suboffsets;
13995  __pyx_v_info->suboffsets = __pyx_t_4;
13996 
13997  /* "View.MemoryView":527
13998  * info.strides = NULL
13999  *
14000  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
14001  * info.suboffsets = self.view.suboffsets
14002  * else:
14003  */
14004  goto __pyx_L8;
14005  }
14006 
14007  /* "View.MemoryView":530
14008  * info.suboffsets = self.view.suboffsets
14009  * else:
14010  * info.suboffsets = NULL # <<<<<<<<<<<<<<
14011  *
14012  * if flags & PyBUF_FORMAT:
14013  */
14014  /*else*/ {
14015  __pyx_v_info->suboffsets = NULL;
14016  }
14017  __pyx_L8:;
14018 
14019  /* "View.MemoryView":532
14020  * info.suboffsets = NULL
14021  *
14022  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
14023  * info.format = self.view.format
14024  * else:
14025  */
14026  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
14027  if (__pyx_t_1) {
14028 
14029  /* "View.MemoryView":533
14030  *
14031  * if flags & PyBUF_FORMAT:
14032  * info.format = self.view.format # <<<<<<<<<<<<<<
14033  * else:
14034  * info.format = NULL
14035  */
14036  __pyx_t_5 = __pyx_v_self->view.format;
14037  __pyx_v_info->format = __pyx_t_5;
14038 
14039  /* "View.MemoryView":532
14040  * info.suboffsets = NULL
14041  *
14042  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
14043  * info.format = self.view.format
14044  * else:
14045  */
14046  goto __pyx_L9;
14047  }
14048 
14049  /* "View.MemoryView":535
14050  * info.format = self.view.format
14051  * else:
14052  * info.format = NULL # <<<<<<<<<<<<<<
14053  *
14054  * info.buf = self.view.buf
14055  */
14056  /*else*/ {
14057  __pyx_v_info->format = NULL;
14058  }
14059  __pyx_L9:;
14060 
14061  /* "View.MemoryView":537
14062  * info.format = NULL
14063  *
14064  * info.buf = self.view.buf # <<<<<<<<<<<<<<
14065  * info.ndim = self.view.ndim
14066  * info.itemsize = self.view.itemsize
14067  */
14068  __pyx_t_6 = __pyx_v_self->view.buf;
14069  __pyx_v_info->buf = __pyx_t_6;
14070 
14071  /* "View.MemoryView":538
14072  *
14073  * info.buf = self.view.buf
14074  * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
14075  * info.itemsize = self.view.itemsize
14076  * info.len = self.view.len
14077  */
14078  __pyx_t_7 = __pyx_v_self->view.ndim;
14079  __pyx_v_info->ndim = __pyx_t_7;
14080 
14081  /* "View.MemoryView":539
14082  * info.buf = self.view.buf
14083  * info.ndim = self.view.ndim
14084  * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
14085  * info.len = self.view.len
14086  * info.readonly = self.view.readonly
14087  */
14088  __pyx_t_8 = __pyx_v_self->view.itemsize;
14089  __pyx_v_info->itemsize = __pyx_t_8;
14090 
14091  /* "View.MemoryView":540
14092  * info.ndim = self.view.ndim
14093  * info.itemsize = self.view.itemsize
14094  * info.len = self.view.len # <<<<<<<<<<<<<<
14095  * info.readonly = self.view.readonly
14096  * info.obj = self
14097  */
14098  __pyx_t_8 = __pyx_v_self->view.len;
14099  __pyx_v_info->len = __pyx_t_8;
14100 
14101  /* "View.MemoryView":541
14102  * info.itemsize = self.view.itemsize
14103  * info.len = self.view.len
14104  * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
14105  * info.obj = self
14106  *
14107  */
14108  __pyx_t_1 = __pyx_v_self->view.readonly;
14109  __pyx_v_info->readonly = __pyx_t_1;
14110 
14111  /* "View.MemoryView":542
14112  * info.len = self.view.len
14113  * info.readonly = self.view.readonly
14114  * info.obj = self # <<<<<<<<<<<<<<
14115  *
14116  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
14117  */
14118  __Pyx_INCREF(((PyObject *)__pyx_v_self));
14119  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
14120  __Pyx_GOTREF(__pyx_v_info->obj);
14121  __Pyx_DECREF(__pyx_v_info->obj);
14122  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
14123 
14124  /* "View.MemoryView":513
14125  *
14126  * @cname('getbuffer')
14127  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
14128  * if flags & PyBUF_WRITABLE and self.view.readonly:
14129  * raise ValueError("Cannot create writable memory view from read-only memoryview")
14130  */
14131 
14132  /* function exit code */
14133  __pyx_r = 0;
14134  goto __pyx_L0;
14135  __pyx_L1_error:;
14136  __Pyx_XDECREF(__pyx_t_3);
14137  __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14138  __pyx_r = -1;
14139  if (__pyx_v_info->obj != NULL) {
14140  __Pyx_GOTREF(__pyx_v_info->obj);
14141  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
14142  }
14143  goto __pyx_L2;
14144  __pyx_L0:;
14145  if (__pyx_v_info->obj == Py_None) {
14146  __Pyx_GOTREF(__pyx_v_info->obj);
14147  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
14148  }
14149  __pyx_L2:;
14150  __Pyx_RefNannyFinishContext();
14151  return __pyx_r;
14152 }
14153 
14154 /* "View.MemoryView":548
14155  *
14156  * @property
14157  * def T(self): # <<<<<<<<<<<<<<
14158  * cdef _memoryviewslice result = memoryview_copy(self)
14159  * transpose_memslice(&result.from_slice)
14160  */
14161 
14162 /* Python wrapper */
14163 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
14164 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
14165  PyObject *__pyx_r = 0;
14166  __Pyx_RefNannyDeclarations
14167  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14168  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14169 
14170  /* function exit code */
14171  __Pyx_RefNannyFinishContext();
14172  return __pyx_r;
14173 }
14174 
14175 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14176  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
14177  PyObject *__pyx_r = NULL;
14178  __Pyx_RefNannyDeclarations
14179  PyObject *__pyx_t_1 = NULL;
14180  int __pyx_t_2;
14181  __Pyx_RefNannySetupContext("__get__", 0);
14182 
14183  /* "View.MemoryView":549
14184  * @property
14185  * def T(self):
14186  * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
14187  * transpose_memslice(&result.from_slice)
14188  * return result
14189  */
14190  __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 549, __pyx_L1_error)
14191  __Pyx_GOTREF(__pyx_t_1);
14192  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 549, __pyx_L1_error)
14193  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
14194  __pyx_t_1 = 0;
14195 
14196  /* "View.MemoryView":550
14197  * def T(self):
14198  * cdef _memoryviewslice result = memoryview_copy(self)
14199  * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
14200  * return result
14201  *
14202  */
14203  __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 550, __pyx_L1_error)
14204 
14205  /* "View.MemoryView":551
14206  * cdef _memoryviewslice result = memoryview_copy(self)
14207  * transpose_memslice(&result.from_slice)
14208  * return result # <<<<<<<<<<<<<<
14209  *
14210  * @property
14211  */
14212  __Pyx_XDECREF(__pyx_r);
14213  __Pyx_INCREF(((PyObject *)__pyx_v_result));
14214  __pyx_r = ((PyObject *)__pyx_v_result);
14215  goto __pyx_L0;
14216 
14217  /* "View.MemoryView":548
14218  *
14219  * @property
14220  * def T(self): # <<<<<<<<<<<<<<
14221  * cdef _memoryviewslice result = memoryview_copy(self)
14222  * transpose_memslice(&result.from_slice)
14223  */
14224 
14225  /* function exit code */
14226  __pyx_L1_error:;
14227  __Pyx_XDECREF(__pyx_t_1);
14228  __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14229  __pyx_r = NULL;
14230  __pyx_L0:;
14231  __Pyx_XDECREF((PyObject *)__pyx_v_result);
14232  __Pyx_XGIVEREF(__pyx_r);
14233  __Pyx_RefNannyFinishContext();
14234  return __pyx_r;
14235 }
14236 
14237 /* "View.MemoryView":554
14238  *
14239  * @property
14240  * def base(self): # <<<<<<<<<<<<<<
14241  * return self.obj
14242  *
14243  */
14244 
14245 /* Python wrapper */
14246 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
14247 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
14248  PyObject *__pyx_r = 0;
14249  __Pyx_RefNannyDeclarations
14250  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14251  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14252 
14253  /* function exit code */
14254  __Pyx_RefNannyFinishContext();
14255  return __pyx_r;
14256 }
14257 
14258 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14259  PyObject *__pyx_r = NULL;
14260  __Pyx_RefNannyDeclarations
14261  __Pyx_RefNannySetupContext("__get__", 0);
14262 
14263  /* "View.MemoryView":555
14264  * @property
14265  * def base(self):
14266  * return self.obj # <<<<<<<<<<<<<<
14267  *
14268  * @property
14269  */
14270  __Pyx_XDECREF(__pyx_r);
14271  __Pyx_INCREF(__pyx_v_self->obj);
14272  __pyx_r = __pyx_v_self->obj;
14273  goto __pyx_L0;
14274 
14275  /* "View.MemoryView":554
14276  *
14277  * @property
14278  * def base(self): # <<<<<<<<<<<<<<
14279  * return self.obj
14280  *
14281  */
14282 
14283  /* function exit code */
14284  __pyx_L0:;
14285  __Pyx_XGIVEREF(__pyx_r);
14286  __Pyx_RefNannyFinishContext();
14287  return __pyx_r;
14288 }
14289 
14290 /* "View.MemoryView":558
14291  *
14292  * @property
14293  * def shape(self): # <<<<<<<<<<<<<<
14294  * return tuple([length for length in self.view.shape[:self.view.ndim]])
14295  *
14296  */
14297 
14298 /* Python wrapper */
14299 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
14300 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
14301  PyObject *__pyx_r = 0;
14302  __Pyx_RefNannyDeclarations
14303  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14304  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14305 
14306  /* function exit code */
14307  __Pyx_RefNannyFinishContext();
14308  return __pyx_r;
14309 }
14310 
14311 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14312  Py_ssize_t __pyx_v_length;
14313  PyObject *__pyx_r = NULL;
14314  __Pyx_RefNannyDeclarations
14315  PyObject *__pyx_t_1 = NULL;
14316  Py_ssize_t *__pyx_t_2;
14317  Py_ssize_t *__pyx_t_3;
14318  Py_ssize_t *__pyx_t_4;
14319  PyObject *__pyx_t_5 = NULL;
14320  __Pyx_RefNannySetupContext("__get__", 0);
14321 
14322  /* "View.MemoryView":559
14323  * @property
14324  * def shape(self):
14325  * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
14326  *
14327  * @property
14328  */
14329  __Pyx_XDECREF(__pyx_r);
14330  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 559, __pyx_L1_error)
14331  __Pyx_GOTREF(__pyx_t_1);
14332  __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
14333  for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
14334  __pyx_t_2 = __pyx_t_4;
14335  __pyx_v_length = (__pyx_t_2[0]);
14336  __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 559, __pyx_L1_error)
14337  __Pyx_GOTREF(__pyx_t_5);
14338  if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 559, __pyx_L1_error)
14339  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14340  }
14341  __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 559, __pyx_L1_error)
14342  __Pyx_GOTREF(__pyx_t_5);
14343  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14344  __pyx_r = __pyx_t_5;
14345  __pyx_t_5 = 0;
14346  goto __pyx_L0;
14347 
14348  /* "View.MemoryView":558
14349  *
14350  * @property
14351  * def shape(self): # <<<<<<<<<<<<<<
14352  * return tuple([length for length in self.view.shape[:self.view.ndim]])
14353  *
14354  */
14355 
14356  /* function exit code */
14357  __pyx_L1_error:;
14358  __Pyx_XDECREF(__pyx_t_1);
14359  __Pyx_XDECREF(__pyx_t_5);
14360  __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14361  __pyx_r = NULL;
14362  __pyx_L0:;
14363  __Pyx_XGIVEREF(__pyx_r);
14364  __Pyx_RefNannyFinishContext();
14365  return __pyx_r;
14366 }
14367 
14368 /* "View.MemoryView":562
14369  *
14370  * @property
14371  * def strides(self): # <<<<<<<<<<<<<<
14372  * if self.view.strides == NULL:
14373  *
14374  */
14375 
14376 /* Python wrapper */
14377 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
14378 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
14379  PyObject *__pyx_r = 0;
14380  __Pyx_RefNannyDeclarations
14381  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14382  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14383 
14384  /* function exit code */
14385  __Pyx_RefNannyFinishContext();
14386  return __pyx_r;
14387 }
14388 
14389 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14390  Py_ssize_t __pyx_v_stride;
14391  PyObject *__pyx_r = NULL;
14392  __Pyx_RefNannyDeclarations
14393  int __pyx_t_1;
14394  PyObject *__pyx_t_2 = NULL;
14395  Py_ssize_t *__pyx_t_3;
14396  Py_ssize_t *__pyx_t_4;
14397  Py_ssize_t *__pyx_t_5;
14398  PyObject *__pyx_t_6 = NULL;
14399  __Pyx_RefNannySetupContext("__get__", 0);
14400 
14401  /* "View.MemoryView":563
14402  * @property
14403  * def strides(self):
14404  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
14405  *
14406  * raise ValueError("Buffer view does not expose strides")
14407  */
14408  __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
14409  if (unlikely(__pyx_t_1)) {
14410 
14411  /* "View.MemoryView":565
14412  * if self.view.strides == NULL:
14413  *
14414  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
14415  *
14416  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
14417  */
14418  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __pyx_L1_error)
14419  __Pyx_GOTREF(__pyx_t_2);
14420  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
14421  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14422  __PYX_ERR(1, 565, __pyx_L1_error)
14423 
14424  /* "View.MemoryView":563
14425  * @property
14426  * def strides(self):
14427  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
14428  *
14429  * raise ValueError("Buffer view does not expose strides")
14430  */
14431  }
14432 
14433  /* "View.MemoryView":567
14434  * raise ValueError("Buffer view does not expose strides")
14435  *
14436  * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
14437  *
14438  * @property
14439  */
14440  __Pyx_XDECREF(__pyx_r);
14441  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 567, __pyx_L1_error)
14442  __Pyx_GOTREF(__pyx_t_2);
14443  __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
14444  for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
14445  __pyx_t_3 = __pyx_t_5;
14446  __pyx_v_stride = (__pyx_t_3[0]);
14447  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 567, __pyx_L1_error)
14448  __Pyx_GOTREF(__pyx_t_6);
14449  if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 567, __pyx_L1_error)
14450  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14451  }
14452  __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 567, __pyx_L1_error)
14453  __Pyx_GOTREF(__pyx_t_6);
14454  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14455  __pyx_r = __pyx_t_6;
14456  __pyx_t_6 = 0;
14457  goto __pyx_L0;
14458 
14459  /* "View.MemoryView":562
14460  *
14461  * @property
14462  * def strides(self): # <<<<<<<<<<<<<<
14463  * if self.view.strides == NULL:
14464  *
14465  */
14466 
14467  /* function exit code */
14468  __pyx_L1_error:;
14469  __Pyx_XDECREF(__pyx_t_2);
14470  __Pyx_XDECREF(__pyx_t_6);
14471  __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14472  __pyx_r = NULL;
14473  __pyx_L0:;
14474  __Pyx_XGIVEREF(__pyx_r);
14475  __Pyx_RefNannyFinishContext();
14476  return __pyx_r;
14477 }
14478 
14479 /* "View.MemoryView":570
14480  *
14481  * @property
14482  * def suboffsets(self): # <<<<<<<<<<<<<<
14483  * if self.view.suboffsets == NULL:
14484  * return (-1,) * self.view.ndim
14485  */
14486 
14487 /* Python wrapper */
14488 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
14489 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
14490  PyObject *__pyx_r = 0;
14491  __Pyx_RefNannyDeclarations
14492  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14493  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14494 
14495  /* function exit code */
14496  __Pyx_RefNannyFinishContext();
14497  return __pyx_r;
14498 }
14499 
14500 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14501  Py_ssize_t __pyx_v_suboffset;
14502  PyObject *__pyx_r = NULL;
14503  __Pyx_RefNannyDeclarations
14504  int __pyx_t_1;
14505  PyObject *__pyx_t_2 = NULL;
14506  PyObject *__pyx_t_3 = NULL;
14507  Py_ssize_t *__pyx_t_4;
14508  Py_ssize_t *__pyx_t_5;
14509  Py_ssize_t *__pyx_t_6;
14510  __Pyx_RefNannySetupContext("__get__", 0);
14511 
14512  /* "View.MemoryView":571
14513  * @property
14514  * def suboffsets(self):
14515  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
14516  * return (-1,) * self.view.ndim
14517  *
14518  */
14519  __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
14520  if (__pyx_t_1) {
14521 
14522  /* "View.MemoryView":572
14523  * def suboffsets(self):
14524  * if self.view.suboffsets == NULL:
14525  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
14526  *
14527  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
14528  */
14529  __Pyx_XDECREF(__pyx_r);
14530  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 572, __pyx_L1_error)
14531  __Pyx_GOTREF(__pyx_t_2);
14532  __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__26, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 572, __pyx_L1_error)
14533  __Pyx_GOTREF(__pyx_t_3);
14534  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14535  __pyx_r = __pyx_t_3;
14536  __pyx_t_3 = 0;
14537  goto __pyx_L0;
14538 
14539  /* "View.MemoryView":571
14540  * @property
14541  * def suboffsets(self):
14542  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
14543  * return (-1,) * self.view.ndim
14544  *
14545  */
14546  }
14547 
14548  /* "View.MemoryView":574
14549  * return (-1,) * self.view.ndim
14550  *
14551  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
14552  *
14553  * @property
14554  */
14555  __Pyx_XDECREF(__pyx_r);
14556  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 574, __pyx_L1_error)
14557  __Pyx_GOTREF(__pyx_t_3);
14558  __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
14559  for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
14560  __pyx_t_4 = __pyx_t_6;
14561  __pyx_v_suboffset = (__pyx_t_4[0]);
14562  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 574, __pyx_L1_error)
14563  __Pyx_GOTREF(__pyx_t_2);
14564  if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 574, __pyx_L1_error)
14565  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14566  }
14567  __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 574, __pyx_L1_error)
14568  __Pyx_GOTREF(__pyx_t_2);
14569  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14570  __pyx_r = __pyx_t_2;
14571  __pyx_t_2 = 0;
14572  goto __pyx_L0;
14573 
14574  /* "View.MemoryView":570
14575  *
14576  * @property
14577  * def suboffsets(self): # <<<<<<<<<<<<<<
14578  * if self.view.suboffsets == NULL:
14579  * return (-1,) * self.view.ndim
14580  */
14581 
14582  /* function exit code */
14583  __pyx_L1_error:;
14584  __Pyx_XDECREF(__pyx_t_2);
14585  __Pyx_XDECREF(__pyx_t_3);
14586  __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14587  __pyx_r = NULL;
14588  __pyx_L0:;
14589  __Pyx_XGIVEREF(__pyx_r);
14590  __Pyx_RefNannyFinishContext();
14591  return __pyx_r;
14592 }
14593 
14594 /* "View.MemoryView":577
14595  *
14596  * @property
14597  * def ndim(self): # <<<<<<<<<<<<<<
14598  * return self.view.ndim
14599  *
14600  */
14601 
14602 /* Python wrapper */
14603 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
14604 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
14605  PyObject *__pyx_r = 0;
14606  __Pyx_RefNannyDeclarations
14607  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14608  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14609 
14610  /* function exit code */
14611  __Pyx_RefNannyFinishContext();
14612  return __pyx_r;
14613 }
14614 
14615 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14616  PyObject *__pyx_r = NULL;
14617  __Pyx_RefNannyDeclarations
14618  PyObject *__pyx_t_1 = NULL;
14619  __Pyx_RefNannySetupContext("__get__", 0);
14620 
14621  /* "View.MemoryView":578
14622  * @property
14623  * def ndim(self):
14624  * return self.view.ndim # <<<<<<<<<<<<<<
14625  *
14626  * @property
14627  */
14628  __Pyx_XDECREF(__pyx_r);
14629  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 578, __pyx_L1_error)
14630  __Pyx_GOTREF(__pyx_t_1);
14631  __pyx_r = __pyx_t_1;
14632  __pyx_t_1 = 0;
14633  goto __pyx_L0;
14634 
14635  /* "View.MemoryView":577
14636  *
14637  * @property
14638  * def ndim(self): # <<<<<<<<<<<<<<
14639  * return self.view.ndim
14640  *
14641  */
14642 
14643  /* function exit code */
14644  __pyx_L1_error:;
14645  __Pyx_XDECREF(__pyx_t_1);
14646  __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14647  __pyx_r = NULL;
14648  __pyx_L0:;
14649  __Pyx_XGIVEREF(__pyx_r);
14650  __Pyx_RefNannyFinishContext();
14651  return __pyx_r;
14652 }
14653 
14654 /* "View.MemoryView":581
14655  *
14656  * @property
14657  * def itemsize(self): # <<<<<<<<<<<<<<
14658  * return self.view.itemsize
14659  *
14660  */
14661 
14662 /* Python wrapper */
14663 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
14664 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
14665  PyObject *__pyx_r = 0;
14666  __Pyx_RefNannyDeclarations
14667  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14668  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14669 
14670  /* function exit code */
14671  __Pyx_RefNannyFinishContext();
14672  return __pyx_r;
14673 }
14674 
14675 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14676  PyObject *__pyx_r = NULL;
14677  __Pyx_RefNannyDeclarations
14678  PyObject *__pyx_t_1 = NULL;
14679  __Pyx_RefNannySetupContext("__get__", 0);
14680 
14681  /* "View.MemoryView":582
14682  * @property
14683  * def itemsize(self):
14684  * return self.view.itemsize # <<<<<<<<<<<<<<
14685  *
14686  * @property
14687  */
14688  __Pyx_XDECREF(__pyx_r);
14689  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 582, __pyx_L1_error)
14690  __Pyx_GOTREF(__pyx_t_1);
14691  __pyx_r = __pyx_t_1;
14692  __pyx_t_1 = 0;
14693  goto __pyx_L0;
14694 
14695  /* "View.MemoryView":581
14696  *
14697  * @property
14698  * def itemsize(self): # <<<<<<<<<<<<<<
14699  * return self.view.itemsize
14700  *
14701  */
14702 
14703  /* function exit code */
14704  __pyx_L1_error:;
14705  __Pyx_XDECREF(__pyx_t_1);
14706  __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14707  __pyx_r = NULL;
14708  __pyx_L0:;
14709  __Pyx_XGIVEREF(__pyx_r);
14710  __Pyx_RefNannyFinishContext();
14711  return __pyx_r;
14712 }
14713 
14714 /* "View.MemoryView":585
14715  *
14716  * @property
14717  * def nbytes(self): # <<<<<<<<<<<<<<
14718  * return self.size * self.view.itemsize
14719  *
14720  */
14721 
14722 /* Python wrapper */
14723 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
14724 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
14725  PyObject *__pyx_r = 0;
14726  __Pyx_RefNannyDeclarations
14727  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14728  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14729 
14730  /* function exit code */
14731  __Pyx_RefNannyFinishContext();
14732  return __pyx_r;
14733 }
14734 
14735 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14736  PyObject *__pyx_r = NULL;
14737  __Pyx_RefNannyDeclarations
14738  PyObject *__pyx_t_1 = NULL;
14739  PyObject *__pyx_t_2 = NULL;
14740  PyObject *__pyx_t_3 = NULL;
14741  __Pyx_RefNannySetupContext("__get__", 0);
14742 
14743  /* "View.MemoryView":586
14744  * @property
14745  * def nbytes(self):
14746  * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
14747  *
14748  * @property
14749  */
14750  __Pyx_XDECREF(__pyx_r);
14751  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 586, __pyx_L1_error)
14752  __Pyx_GOTREF(__pyx_t_1);
14753  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 586, __pyx_L1_error)
14754  __Pyx_GOTREF(__pyx_t_2);
14755  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 586, __pyx_L1_error)
14756  __Pyx_GOTREF(__pyx_t_3);
14757  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14758  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14759  __pyx_r = __pyx_t_3;
14760  __pyx_t_3 = 0;
14761  goto __pyx_L0;
14762 
14763  /* "View.MemoryView":585
14764  *
14765  * @property
14766  * def nbytes(self): # <<<<<<<<<<<<<<
14767  * return self.size * self.view.itemsize
14768  *
14769  */
14770 
14771  /* function exit code */
14772  __pyx_L1_error:;
14773  __Pyx_XDECREF(__pyx_t_1);
14774  __Pyx_XDECREF(__pyx_t_2);
14775  __Pyx_XDECREF(__pyx_t_3);
14776  __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14777  __pyx_r = NULL;
14778  __pyx_L0:;
14779  __Pyx_XGIVEREF(__pyx_r);
14780  __Pyx_RefNannyFinishContext();
14781  return __pyx_r;
14782 }
14783 
14784 /* "View.MemoryView":589
14785  *
14786  * @property
14787  * def size(self): # <<<<<<<<<<<<<<
14788  * if self._size is None:
14789  * result = 1
14790  */
14791 
14792 /* Python wrapper */
14793 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
14794 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
14795  PyObject *__pyx_r = 0;
14796  __Pyx_RefNannyDeclarations
14797  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14798  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14799 
14800  /* function exit code */
14801  __Pyx_RefNannyFinishContext();
14802  return __pyx_r;
14803 }
14804 
14805 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14806  PyObject *__pyx_v_result = NULL;
14807  PyObject *__pyx_v_length = NULL;
14808  PyObject *__pyx_r = NULL;
14809  __Pyx_RefNannyDeclarations
14810  int __pyx_t_1;
14811  int __pyx_t_2;
14812  Py_ssize_t *__pyx_t_3;
14813  Py_ssize_t *__pyx_t_4;
14814  Py_ssize_t *__pyx_t_5;
14815  PyObject *__pyx_t_6 = NULL;
14816  __Pyx_RefNannySetupContext("__get__", 0);
14817 
14818  /* "View.MemoryView":590
14819  * @property
14820  * def size(self):
14821  * if self._size is None: # <<<<<<<<<<<<<<
14822  * result = 1
14823  *
14824  */
14825  __pyx_t_1 = (__pyx_v_self->_size == Py_None);
14826  __pyx_t_2 = (__pyx_t_1 != 0);
14827  if (__pyx_t_2) {
14828 
14829  /* "View.MemoryView":591
14830  * def size(self):
14831  * if self._size is None:
14832  * result = 1 # <<<<<<<<<<<<<<
14833  *
14834  * for length in self.view.shape[:self.view.ndim]:
14835  */
14836  __Pyx_INCREF(__pyx_int_1);
14837  __pyx_v_result = __pyx_int_1;
14838 
14839  /* "View.MemoryView":593
14840  * result = 1
14841  *
14842  * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
14843  * result *= length
14844  *
14845  */
14846  __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
14847  for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
14848  __pyx_t_3 = __pyx_t_5;
14849  __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 593, __pyx_L1_error)
14850  __Pyx_GOTREF(__pyx_t_6);
14851  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
14852  __pyx_t_6 = 0;
14853 
14854  /* "View.MemoryView":594
14855  *
14856  * for length in self.view.shape[:self.view.ndim]:
14857  * result *= length # <<<<<<<<<<<<<<
14858  *
14859  * self._size = result
14860  */
14861  __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 594, __pyx_L1_error)
14862  __Pyx_GOTREF(__pyx_t_6);
14863  __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
14864  __pyx_t_6 = 0;
14865  }
14866 
14867  /* "View.MemoryView":596
14868  * result *= length
14869  *
14870  * self._size = result # <<<<<<<<<<<<<<
14871  *
14872  * return self._size
14873  */
14874  __Pyx_INCREF(__pyx_v_result);
14875  __Pyx_GIVEREF(__pyx_v_result);
14876  __Pyx_GOTREF(__pyx_v_self->_size);
14877  __Pyx_DECREF(__pyx_v_self->_size);
14878  __pyx_v_self->_size = __pyx_v_result;
14879 
14880  /* "View.MemoryView":590
14881  * @property
14882  * def size(self):
14883  * if self._size is None: # <<<<<<<<<<<<<<
14884  * result = 1
14885  *
14886  */
14887  }
14888 
14889  /* "View.MemoryView":598
14890  * self._size = result
14891  *
14892  * return self._size # <<<<<<<<<<<<<<
14893  *
14894  * def __len__(self):
14895  */
14896  __Pyx_XDECREF(__pyx_r);
14897  __Pyx_INCREF(__pyx_v_self->_size);
14898  __pyx_r = __pyx_v_self->_size;
14899  goto __pyx_L0;
14900 
14901  /* "View.MemoryView":589
14902  *
14903  * @property
14904  * def size(self): # <<<<<<<<<<<<<<
14905  * if self._size is None:
14906  * result = 1
14907  */
14908 
14909  /* function exit code */
14910  __pyx_L1_error:;
14911  __Pyx_XDECREF(__pyx_t_6);
14912  __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14913  __pyx_r = NULL;
14914  __pyx_L0:;
14915  __Pyx_XDECREF(__pyx_v_result);
14916  __Pyx_XDECREF(__pyx_v_length);
14917  __Pyx_XGIVEREF(__pyx_r);
14918  __Pyx_RefNannyFinishContext();
14919  return __pyx_r;
14920 }
14921 
14922 /* "View.MemoryView":600
14923  * return self._size
14924  *
14925  * def __len__(self): # <<<<<<<<<<<<<<
14926  * if self.view.ndim >= 1:
14927  * return self.view.shape[0]
14928  */
14929 
14930 /* Python wrapper */
14931 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
14932 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
14933  Py_ssize_t __pyx_r;
14934  __Pyx_RefNannyDeclarations
14935  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
14936  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14937 
14938  /* function exit code */
14939  __Pyx_RefNannyFinishContext();
14940  return __pyx_r;
14941 }
14942 
14943 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
14944  Py_ssize_t __pyx_r;
14945  __Pyx_RefNannyDeclarations
14946  int __pyx_t_1;
14947  __Pyx_RefNannySetupContext("__len__", 0);
14948 
14949  /* "View.MemoryView":601
14950  *
14951  * def __len__(self):
14952  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
14953  * return self.view.shape[0]
14954  *
14955  */
14956  __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
14957  if (__pyx_t_1) {
14958 
14959  /* "View.MemoryView":602
14960  * def __len__(self):
14961  * if self.view.ndim >= 1:
14962  * return self.view.shape[0] # <<<<<<<<<<<<<<
14963  *
14964  * return 0
14965  */
14966  __pyx_r = (__pyx_v_self->view.shape[0]);
14967  goto __pyx_L0;
14968 
14969  /* "View.MemoryView":601
14970  *
14971  * def __len__(self):
14972  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
14973  * return self.view.shape[0]
14974  *
14975  */
14976  }
14977 
14978  /* "View.MemoryView":604
14979  * return self.view.shape[0]
14980  *
14981  * return 0 # <<<<<<<<<<<<<<
14982  *
14983  * def __repr__(self):
14984  */
14985  __pyx_r = 0;
14986  goto __pyx_L0;
14987 
14988  /* "View.MemoryView":600
14989  * return self._size
14990  *
14991  * def __len__(self): # <<<<<<<<<<<<<<
14992  * if self.view.ndim >= 1:
14993  * return self.view.shape[0]
14994  */
14995 
14996  /* function exit code */
14997  __pyx_L0:;
14998  __Pyx_RefNannyFinishContext();
14999  return __pyx_r;
15000 }
15001 
15002 /* "View.MemoryView":606
15003  * return 0
15004  *
15005  * def __repr__(self): # <<<<<<<<<<<<<<
15006  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
15007  * id(self))
15008  */
15009 
15010 /* Python wrapper */
15011 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
15012 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
15013  PyObject *__pyx_r = 0;
15014  __Pyx_RefNannyDeclarations
15015  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
15016  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
15017 
15018  /* function exit code */
15019  __Pyx_RefNannyFinishContext();
15020  return __pyx_r;
15021 }
15022 
15023 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
15024  PyObject *__pyx_r = NULL;
15025  __Pyx_RefNannyDeclarations
15026  PyObject *__pyx_t_1 = NULL;
15027  PyObject *__pyx_t_2 = NULL;
15028  PyObject *__pyx_t_3 = NULL;
15029  __Pyx_RefNannySetupContext("__repr__", 0);
15030 
15031  /* "View.MemoryView":607
15032  *
15033  * def __repr__(self):
15034  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
15035  * id(self))
15036  *
15037  */
15038  __Pyx_XDECREF(__pyx_r);
15039  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 607, __pyx_L1_error)
15040  __Pyx_GOTREF(__pyx_t_1);
15041  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 607, __pyx_L1_error)
15042  __Pyx_GOTREF(__pyx_t_2);
15043  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15044  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 607, __pyx_L1_error)
15045  __Pyx_GOTREF(__pyx_t_1);
15046  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15047 
15048  /* "View.MemoryView":608
15049  * def __repr__(self):
15050  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
15051  * id(self)) # <<<<<<<<<<<<<<
15052  *
15053  * def __str__(self):
15054  */
15055  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 608, __pyx_L1_error)
15056  __Pyx_GOTREF(__pyx_t_2);
15057 
15058  /* "View.MemoryView":607
15059  *
15060  * def __repr__(self):
15061  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
15062  * id(self))
15063  *
15064  */
15065  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 607, __pyx_L1_error)
15066  __Pyx_GOTREF(__pyx_t_3);
15067  __Pyx_GIVEREF(__pyx_t_1);
15068  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
15069  __Pyx_GIVEREF(__pyx_t_2);
15070  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
15071  __pyx_t_1 = 0;
15072  __pyx_t_2 = 0;
15073  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 607, __pyx_L1_error)
15074  __Pyx_GOTREF(__pyx_t_2);
15075  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15076  __pyx_r = __pyx_t_2;
15077  __pyx_t_2 = 0;
15078  goto __pyx_L0;
15079 
15080  /* "View.MemoryView":606
15081  * return 0
15082  *
15083  * def __repr__(self): # <<<<<<<<<<<<<<
15084  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
15085  * id(self))
15086  */
15087 
15088  /* function exit code */
15089  __pyx_L1_error:;
15090  __Pyx_XDECREF(__pyx_t_1);
15091  __Pyx_XDECREF(__pyx_t_2);
15092  __Pyx_XDECREF(__pyx_t_3);
15093  __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15094  __pyx_r = NULL;
15095  __pyx_L0:;
15096  __Pyx_XGIVEREF(__pyx_r);
15097  __Pyx_RefNannyFinishContext();
15098  return __pyx_r;
15099 }
15100 
15101 /* "View.MemoryView":610
15102  * id(self))
15103  *
15104  * def __str__(self): # <<<<<<<<<<<<<<
15105  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
15106  *
15107  */
15108 
15109 /* Python wrapper */
15110 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
15111 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
15112  PyObject *__pyx_r = 0;
15113  __Pyx_RefNannyDeclarations
15114  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
15115  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
15116 
15117  /* function exit code */
15118  __Pyx_RefNannyFinishContext();
15119  return __pyx_r;
15120 }
15121 
15122 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
15123  PyObject *__pyx_r = NULL;
15124  __Pyx_RefNannyDeclarations
15125  PyObject *__pyx_t_1 = NULL;
15126  PyObject *__pyx_t_2 = NULL;
15127  __Pyx_RefNannySetupContext("__str__", 0);
15128 
15129  /* "View.MemoryView":611
15130  *
15131  * def __str__(self):
15132  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
15133  *
15134  *
15135  */
15136  __Pyx_XDECREF(__pyx_r);
15137  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 611, __pyx_L1_error)
15138  __Pyx_GOTREF(__pyx_t_1);
15139  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 611, __pyx_L1_error)
15140  __Pyx_GOTREF(__pyx_t_2);
15141  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15142  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 611, __pyx_L1_error)
15143  __Pyx_GOTREF(__pyx_t_1);
15144  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15145  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 611, __pyx_L1_error)
15146  __Pyx_GOTREF(__pyx_t_2);
15147  __Pyx_GIVEREF(__pyx_t_1);
15148  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
15149  __pyx_t_1 = 0;
15150  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 611, __pyx_L1_error)
15151  __Pyx_GOTREF(__pyx_t_1);
15152  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15153  __pyx_r = __pyx_t_1;
15154  __pyx_t_1 = 0;
15155  goto __pyx_L0;
15156 
15157  /* "View.MemoryView":610
15158  * id(self))
15159  *
15160  * def __str__(self): # <<<<<<<<<<<<<<
15161  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
15162  *
15163  */
15164 
15165  /* function exit code */
15166  __pyx_L1_error:;
15167  __Pyx_XDECREF(__pyx_t_1);
15168  __Pyx_XDECREF(__pyx_t_2);
15169  __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15170  __pyx_r = NULL;
15171  __pyx_L0:;
15172  __Pyx_XGIVEREF(__pyx_r);
15173  __Pyx_RefNannyFinishContext();
15174  return __pyx_r;
15175 }
15176 
15177 /* "View.MemoryView":614
15178  *
15179  *
15180  * def is_c_contig(self): # <<<<<<<<<<<<<<
15181  * cdef __Pyx_memviewslice *mslice
15182  * cdef __Pyx_memviewslice tmp
15183  */
15184 
15185 /* Python wrapper */
15186 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
15187 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15188  PyObject *__pyx_r = 0;
15189  __Pyx_RefNannyDeclarations
15190  __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
15191  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
15192 
15193  /* function exit code */
15194  __Pyx_RefNannyFinishContext();
15195  return __pyx_r;
15196 }
15197 
15198 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
15199  __Pyx_memviewslice *__pyx_v_mslice;
15200  __Pyx_memviewslice __pyx_v_tmp;
15201  PyObject *__pyx_r = NULL;
15202  __Pyx_RefNannyDeclarations
15203  PyObject *__pyx_t_1 = NULL;
15204  __Pyx_RefNannySetupContext("is_c_contig", 0);
15205 
15206  /* "View.MemoryView":617
15207  * cdef __Pyx_memviewslice *mslice
15208  * cdef __Pyx_memviewslice tmp
15209  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
15210  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
15211  *
15212  */
15213  __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
15214 
15215  /* "View.MemoryView":618
15216  * cdef __Pyx_memviewslice tmp
15217  * mslice = get_slice_from_memview(self, &tmp)
15218  * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
15219  *
15220  * def is_f_contig(self):
15221  */
15222  __Pyx_XDECREF(__pyx_r);
15223  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 618, __pyx_L1_error)
15224  __Pyx_GOTREF(__pyx_t_1);
15225  __pyx_r = __pyx_t_1;
15226  __pyx_t_1 = 0;
15227  goto __pyx_L0;
15228 
15229  /* "View.MemoryView":614
15230  *
15231  *
15232  * def is_c_contig(self): # <<<<<<<<<<<<<<
15233  * cdef __Pyx_memviewslice *mslice
15234  * cdef __Pyx_memviewslice tmp
15235  */
15236 
15237  /* function exit code */
15238  __pyx_L1_error:;
15239  __Pyx_XDECREF(__pyx_t_1);
15240  __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
15241  __pyx_r = NULL;
15242  __pyx_L0:;
15243  __Pyx_XGIVEREF(__pyx_r);
15244  __Pyx_RefNannyFinishContext();
15245  return __pyx_r;
15246 }
15247 
15248 /* "View.MemoryView":620
15249  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
15250  *
15251  * def is_f_contig(self): # <<<<<<<<<<<<<<
15252  * cdef __Pyx_memviewslice *mslice
15253  * cdef __Pyx_memviewslice tmp
15254  */
15255 
15256 /* Python wrapper */
15257 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
15258 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15259  PyObject *__pyx_r = 0;
15260  __Pyx_RefNannyDeclarations
15261  __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
15262  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
15263 
15264  /* function exit code */
15265  __Pyx_RefNannyFinishContext();
15266  return __pyx_r;
15267 }
15268 
15269 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
15270  __Pyx_memviewslice *__pyx_v_mslice;
15271  __Pyx_memviewslice __pyx_v_tmp;
15272  PyObject *__pyx_r = NULL;
15273  __Pyx_RefNannyDeclarations
15274  PyObject *__pyx_t_1 = NULL;
15275  __Pyx_RefNannySetupContext("is_f_contig", 0);
15276 
15277  /* "View.MemoryView":623
15278  * cdef __Pyx_memviewslice *mslice
15279  * cdef __Pyx_memviewslice tmp
15280  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
15281  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
15282  *
15283  */
15284  __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
15285 
15286  /* "View.MemoryView":624
15287  * cdef __Pyx_memviewslice tmp
15288  * mslice = get_slice_from_memview(self, &tmp)
15289  * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
15290  *
15291  * def copy(self):
15292  */
15293  __Pyx_XDECREF(__pyx_r);
15294  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 624, __pyx_L1_error)
15295  __Pyx_GOTREF(__pyx_t_1);
15296  __pyx_r = __pyx_t_1;
15297  __pyx_t_1 = 0;
15298  goto __pyx_L0;
15299 
15300  /* "View.MemoryView":620
15301  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
15302  *
15303  * def is_f_contig(self): # <<<<<<<<<<<<<<
15304  * cdef __Pyx_memviewslice *mslice
15305  * cdef __Pyx_memviewslice tmp
15306  */
15307 
15308  /* function exit code */
15309  __pyx_L1_error:;
15310  __Pyx_XDECREF(__pyx_t_1);
15311  __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
15312  __pyx_r = NULL;
15313  __pyx_L0:;
15314  __Pyx_XGIVEREF(__pyx_r);
15315  __Pyx_RefNannyFinishContext();
15316  return __pyx_r;
15317 }
15318 
15319 /* "View.MemoryView":626
15320  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
15321  *
15322  * def copy(self): # <<<<<<<<<<<<<<
15323  * cdef __Pyx_memviewslice mslice
15324  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
15325  */
15326 
15327 /* Python wrapper */
15328 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
15329 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15330  PyObject *__pyx_r = 0;
15331  __Pyx_RefNannyDeclarations
15332  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
15333  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
15334 
15335  /* function exit code */
15336  __Pyx_RefNannyFinishContext();
15337  return __pyx_r;
15338 }
15339 
15340 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
15341  __Pyx_memviewslice __pyx_v_mslice;
15342  int __pyx_v_flags;
15343  PyObject *__pyx_r = NULL;
15344  __Pyx_RefNannyDeclarations
15345  __Pyx_memviewslice __pyx_t_1;
15346  PyObject *__pyx_t_2 = NULL;
15347  __Pyx_RefNannySetupContext("copy", 0);
15348 
15349  /* "View.MemoryView":628
15350  * def copy(self):
15351  * cdef __Pyx_memviewslice mslice
15352  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
15353  *
15354  * slice_copy(self, &mslice)
15355  */
15356  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
15357 
15358  /* "View.MemoryView":630
15359  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
15360  *
15361  * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
15362  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
15363  * self.view.itemsize,
15364  */
15365  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
15366 
15367  /* "View.MemoryView":631
15368  *
15369  * slice_copy(self, &mslice)
15370  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
15371  * self.view.itemsize,
15372  * flags|PyBUF_C_CONTIGUOUS,
15373  */
15374  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 631, __pyx_L1_error)
15375  __pyx_v_mslice = __pyx_t_1;
15376 
15377  /* "View.MemoryView":636
15378  * self.dtype_is_object)
15379  *
15380  * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
15381  *
15382  * def copy_fortran(self):
15383  */
15384  __Pyx_XDECREF(__pyx_r);
15385  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 636, __pyx_L1_error)
15386  __Pyx_GOTREF(__pyx_t_2);
15387  __pyx_r = __pyx_t_2;
15388  __pyx_t_2 = 0;
15389  goto __pyx_L0;
15390 
15391  /* "View.MemoryView":626
15392  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
15393  *
15394  * def copy(self): # <<<<<<<<<<<<<<
15395  * cdef __Pyx_memviewslice mslice
15396  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
15397  */
15398 
15399  /* function exit code */
15400  __pyx_L1_error:;
15401  __Pyx_XDECREF(__pyx_t_2);
15402  __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
15403  __pyx_r = NULL;
15404  __pyx_L0:;
15405  __Pyx_XGIVEREF(__pyx_r);
15406  __Pyx_RefNannyFinishContext();
15407  return __pyx_r;
15408 }
15409 
15410 /* "View.MemoryView":638
15411  * return memoryview_copy_from_slice(self, &mslice)
15412  *
15413  * def copy_fortran(self): # <<<<<<<<<<<<<<
15414  * cdef __Pyx_memviewslice src, dst
15415  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
15416  */
15417 
15418 /* Python wrapper */
15419 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
15420 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15421  PyObject *__pyx_r = 0;
15422  __Pyx_RefNannyDeclarations
15423  __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
15424  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
15425 
15426  /* function exit code */
15427  __Pyx_RefNannyFinishContext();
15428  return __pyx_r;
15429 }
15430 
15431 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
15432  __Pyx_memviewslice __pyx_v_src;
15433  __Pyx_memviewslice __pyx_v_dst;
15434  int __pyx_v_flags;
15435  PyObject *__pyx_r = NULL;
15436  __Pyx_RefNannyDeclarations
15437  __Pyx_memviewslice __pyx_t_1;
15438  PyObject *__pyx_t_2 = NULL;
15439  __Pyx_RefNannySetupContext("copy_fortran", 0);
15440 
15441  /* "View.MemoryView":640
15442  * def copy_fortran(self):
15443  * cdef __Pyx_memviewslice src, dst
15444  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
15445  *
15446  * slice_copy(self, &src)
15447  */
15448  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
15449 
15450  /* "View.MemoryView":642
15451  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
15452  *
15453  * slice_copy(self, &src) # <<<<<<<<<<<<<<
15454  * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
15455  * self.view.itemsize,
15456  */
15457  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
15458 
15459  /* "View.MemoryView":643
15460  *
15461  * slice_copy(self, &src)
15462  * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
15463  * self.view.itemsize,
15464  * flags|PyBUF_F_CONTIGUOUS,
15465  */
15466  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 643, __pyx_L1_error)
15467  __pyx_v_dst = __pyx_t_1;
15468 
15469  /* "View.MemoryView":648
15470  * self.dtype_is_object)
15471  *
15472  * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
15473  *
15474  *
15475  */
15476  __Pyx_XDECREF(__pyx_r);
15477  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 648, __pyx_L1_error)
15478  __Pyx_GOTREF(__pyx_t_2);
15479  __pyx_r = __pyx_t_2;
15480  __pyx_t_2 = 0;
15481  goto __pyx_L0;
15482 
15483  /* "View.MemoryView":638
15484  * return memoryview_copy_from_slice(self, &mslice)
15485  *
15486  * def copy_fortran(self): # <<<<<<<<<<<<<<
15487  * cdef __Pyx_memviewslice src, dst
15488  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
15489  */
15490 
15491  /* function exit code */
15492  __pyx_L1_error:;
15493  __Pyx_XDECREF(__pyx_t_2);
15494  __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
15495  __pyx_r = NULL;
15496  __pyx_L0:;
15497  __Pyx_XGIVEREF(__pyx_r);
15498  __Pyx_RefNannyFinishContext();
15499  return __pyx_r;
15500 }
15501 
15502 /* "(tree fragment)":1
15503  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
15504  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15505  * def __setstate_cython__(self, __pyx_state):
15506  */
15507 
15508 /* Python wrapper */
15509 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
15510 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15511  PyObject *__pyx_r = 0;
15512  __Pyx_RefNannyDeclarations
15513  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
15514  __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
15515 
15516  /* function exit code */
15517  __Pyx_RefNannyFinishContext();
15518  return __pyx_r;
15519 }
15520 
15521 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
15522  PyObject *__pyx_r = NULL;
15523  __Pyx_RefNannyDeclarations
15524  PyObject *__pyx_t_1 = NULL;
15525  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
15526 
15527  /* "(tree fragment)":2
15528  * def __reduce_cython__(self):
15529  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
15530  * def __setstate_cython__(self, __pyx_state):
15531  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15532  */
15533  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
15534  __Pyx_GOTREF(__pyx_t_1);
15535  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
15536  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15537  __PYX_ERR(1, 2, __pyx_L1_error)
15538 
15539  /* "(tree fragment)":1
15540  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
15541  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15542  * def __setstate_cython__(self, __pyx_state):
15543  */
15544 
15545  /* function exit code */
15546  __pyx_L1_error:;
15547  __Pyx_XDECREF(__pyx_t_1);
15548  __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15549  __pyx_r = NULL;
15550  __Pyx_XGIVEREF(__pyx_r);
15551  __Pyx_RefNannyFinishContext();
15552  return __pyx_r;
15553 }
15554 
15555 /* "(tree fragment)":3
15556  * def __reduce_cython__(self):
15557  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15558  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
15559  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15560  */
15561 
15562 /* Python wrapper */
15563 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
15564 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
15565  PyObject *__pyx_r = 0;
15566  __Pyx_RefNannyDeclarations
15567  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
15568  __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
15569 
15570  /* function exit code */
15571  __Pyx_RefNannyFinishContext();
15572  return __pyx_r;
15573 }
15574 
15575 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
15576  PyObject *__pyx_r = NULL;
15577  __Pyx_RefNannyDeclarations
15578  PyObject *__pyx_t_1 = NULL;
15579  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
15580 
15581  /* "(tree fragment)":4
15582  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15583  * def __setstate_cython__(self, __pyx_state):
15584  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
15585  */
15586  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
15587  __Pyx_GOTREF(__pyx_t_1);
15588  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
15589  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15590  __PYX_ERR(1, 4, __pyx_L1_error)
15591 
15592  /* "(tree fragment)":3
15593  * def __reduce_cython__(self):
15594  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15595  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
15596  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15597  */
15598 
15599  /* function exit code */
15600  __pyx_L1_error:;
15601  __Pyx_XDECREF(__pyx_t_1);
15602  __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15603  __pyx_r = NULL;
15604  __Pyx_XGIVEREF(__pyx_r);
15605  __Pyx_RefNannyFinishContext();
15606  return __pyx_r;
15607 }
15608 
15609 /* "View.MemoryView":652
15610  *
15611  * @cname('__pyx_memoryview_new')
15612  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
15613  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
15614  * result.typeinfo = typeinfo
15615  */
15616 
15617 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
15618  struct __pyx_memoryview_obj *__pyx_v_result = 0;
15619  PyObject *__pyx_r = NULL;
15620  __Pyx_RefNannyDeclarations
15621  PyObject *__pyx_t_1 = NULL;
15622  PyObject *__pyx_t_2 = NULL;
15623  PyObject *__pyx_t_3 = NULL;
15624  __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
15625 
15626  /* "View.MemoryView":653
15627  * @cname('__pyx_memoryview_new')
15628  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
15629  * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
15630  * result.typeinfo = typeinfo
15631  * return result
15632  */
15633  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 653, __pyx_L1_error)
15634  __Pyx_GOTREF(__pyx_t_1);
15635  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 653, __pyx_L1_error)
15636  __Pyx_GOTREF(__pyx_t_2);
15637  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 653, __pyx_L1_error)
15638  __Pyx_GOTREF(__pyx_t_3);
15639  __Pyx_INCREF(__pyx_v_o);
15640  __Pyx_GIVEREF(__pyx_v_o);
15641  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
15642  __Pyx_GIVEREF(__pyx_t_1);
15643  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
15644  __Pyx_GIVEREF(__pyx_t_2);
15645  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
15646  __pyx_t_1 = 0;
15647  __pyx_t_2 = 0;
15648  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 653, __pyx_L1_error)
15649  __Pyx_GOTREF(__pyx_t_2);
15650  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15651  __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
15652  __pyx_t_2 = 0;
15653 
15654  /* "View.MemoryView":654
15655  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
15656  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
15657  * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
15658  * return result
15659  *
15660  */
15661  __pyx_v_result->typeinfo = __pyx_v_typeinfo;
15662 
15663  /* "View.MemoryView":655
15664  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
15665  * result.typeinfo = typeinfo
15666  * return result # <<<<<<<<<<<<<<
15667  *
15668  * @cname('__pyx_memoryview_check')
15669  */
15670  __Pyx_XDECREF(__pyx_r);
15671  __Pyx_INCREF(((PyObject *)__pyx_v_result));
15672  __pyx_r = ((PyObject *)__pyx_v_result);
15673  goto __pyx_L0;
15674 
15675  /* "View.MemoryView":652
15676  *
15677  * @cname('__pyx_memoryview_new')
15678  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
15679  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
15680  * result.typeinfo = typeinfo
15681  */
15682 
15683  /* function exit code */
15684  __pyx_L1_error:;
15685  __Pyx_XDECREF(__pyx_t_1);
15686  __Pyx_XDECREF(__pyx_t_2);
15687  __Pyx_XDECREF(__pyx_t_3);
15688  __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
15689  __pyx_r = 0;
15690  __pyx_L0:;
15691  __Pyx_XDECREF((PyObject *)__pyx_v_result);
15692  __Pyx_XGIVEREF(__pyx_r);
15693  __Pyx_RefNannyFinishContext();
15694  return __pyx_r;
15695 }
15696 
15697 /* "View.MemoryView":658
15698  *
15699  * @cname('__pyx_memoryview_check')
15700  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
15701  * return isinstance(o, memoryview)
15702  *
15703  */
15704 
15705 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
15706  int __pyx_r;
15707  __Pyx_RefNannyDeclarations
15708  int __pyx_t_1;
15709  __Pyx_RefNannySetupContext("memoryview_check", 0);
15710 
15711  /* "View.MemoryView":659
15712  * @cname('__pyx_memoryview_check')
15713  * cdef inline bint memoryview_check(object o):
15714  * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
15715  *
15716  * cdef tuple _unellipsify(object index, int ndim):
15717  */
15718  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
15719  __pyx_r = __pyx_t_1;
15720  goto __pyx_L0;
15721 
15722  /* "View.MemoryView":658
15723  *
15724  * @cname('__pyx_memoryview_check')
15725  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
15726  * return isinstance(o, memoryview)
15727  *
15728  */
15729 
15730  /* function exit code */
15731  __pyx_L0:;
15732  __Pyx_RefNannyFinishContext();
15733  return __pyx_r;
15734 }
15735 
15736 /* "View.MemoryView":661
15737  * return isinstance(o, memoryview)
15738  *
15739  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
15740  * """
15741  * Replace all ellipses with full slices and fill incomplete indices with
15742  */
15743 
15744 static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
15745  PyObject *__pyx_v_tup = NULL;
15746  PyObject *__pyx_v_result = NULL;
15747  int __pyx_v_have_slices;
15748  int __pyx_v_seen_ellipsis;
15749  CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
15750  PyObject *__pyx_v_item = NULL;
15751  Py_ssize_t __pyx_v_nslices;
15752  PyObject *__pyx_r = NULL;
15753  __Pyx_RefNannyDeclarations
15754  int __pyx_t_1;
15755  int __pyx_t_2;
15756  PyObject *__pyx_t_3 = NULL;
15757  PyObject *__pyx_t_4 = NULL;
15758  Py_ssize_t __pyx_t_5;
15759  PyObject *(*__pyx_t_6)(PyObject *);
15760  PyObject *__pyx_t_7 = NULL;
15761  Py_ssize_t __pyx_t_8;
15762  int __pyx_t_9;
15763  int __pyx_t_10;
15764  PyObject *__pyx_t_11 = NULL;
15765  __Pyx_RefNannySetupContext("_unellipsify", 0);
15766 
15767  /* "View.MemoryView":666
15768  * full slices.
15769  * """
15770  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
15771  * tup = (index,)
15772  * else:
15773  */
15774  __pyx_t_1 = PyTuple_Check(__pyx_v_index);
15775  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
15776  if (__pyx_t_2) {
15777 
15778  /* "View.MemoryView":667
15779  * """
15780  * if not isinstance(index, tuple):
15781  * tup = (index,) # <<<<<<<<<<<<<<
15782  * else:
15783  * tup = index
15784  */
15785  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 667, __pyx_L1_error)
15786  __Pyx_GOTREF(__pyx_t_3);
15787  __Pyx_INCREF(__pyx_v_index);
15788  __Pyx_GIVEREF(__pyx_v_index);
15789  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
15790  __pyx_v_tup = __pyx_t_3;
15791  __pyx_t_3 = 0;
15792 
15793  /* "View.MemoryView":666
15794  * full slices.
15795  * """
15796  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
15797  * tup = (index,)
15798  * else:
15799  */
15800  goto __pyx_L3;
15801  }
15802 
15803  /* "View.MemoryView":669
15804  * tup = (index,)
15805  * else:
15806  * tup = index # <<<<<<<<<<<<<<
15807  *
15808  * result = []
15809  */
15810  /*else*/ {
15811  __Pyx_INCREF(__pyx_v_index);
15812  __pyx_v_tup = __pyx_v_index;
15813  }
15814  __pyx_L3:;
15815 
15816  /* "View.MemoryView":671
15817  * tup = index
15818  *
15819  * result = [] # <<<<<<<<<<<<<<
15820  * have_slices = False
15821  * seen_ellipsis = False
15822  */
15823  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 671, __pyx_L1_error)
15824  __Pyx_GOTREF(__pyx_t_3);
15825  __pyx_v_result = ((PyObject*)__pyx_t_3);
15826  __pyx_t_3 = 0;
15827 
15828  /* "View.MemoryView":672
15829  *
15830  * result = []
15831  * have_slices = False # <<<<<<<<<<<<<<
15832  * seen_ellipsis = False
15833  * for idx, item in enumerate(tup):
15834  */
15835  __pyx_v_have_slices = 0;
15836 
15837  /* "View.MemoryView":673
15838  * result = []
15839  * have_slices = False
15840  * seen_ellipsis = False # <<<<<<<<<<<<<<
15841  * for idx, item in enumerate(tup):
15842  * if item is Ellipsis:
15843  */
15844  __pyx_v_seen_ellipsis = 0;
15845 
15846  /* "View.MemoryView":674
15847  * have_slices = False
15848  * seen_ellipsis = False
15849  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
15850  * if item is Ellipsis:
15851  * if not seen_ellipsis:
15852  */
15853  __Pyx_INCREF(__pyx_int_0);
15854  __pyx_t_3 = __pyx_int_0;
15855  if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
15856  __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
15857  __pyx_t_6 = NULL;
15858  } else {
15859  __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 674, __pyx_L1_error)
15860  __Pyx_GOTREF(__pyx_t_4);
15861  __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 674, __pyx_L1_error)
15862  }
15863  for (;;) {
15864  if (likely(!__pyx_t_6)) {
15865  if (likely(PyList_CheckExact(__pyx_t_4))) {
15866  if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
15867  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15868  __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 674, __pyx_L1_error)
15869  #else
15870  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 674, __pyx_L1_error)
15871  __Pyx_GOTREF(__pyx_t_7);
15872  #endif
15873  } else {
15874  if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
15875  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15876  __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 674, __pyx_L1_error)
15877  #else
15878  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 674, __pyx_L1_error)
15879  __Pyx_GOTREF(__pyx_t_7);
15880  #endif
15881  }
15882  } else {
15883  __pyx_t_7 = __pyx_t_6(__pyx_t_4);
15884  if (unlikely(!__pyx_t_7)) {
15885  PyObject* exc_type = PyErr_Occurred();
15886  if (exc_type) {
15887  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
15888  else __PYX_ERR(1, 674, __pyx_L1_error)
15889  }
15890  break;
15891  }
15892  __Pyx_GOTREF(__pyx_t_7);
15893  }
15894  __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
15895  __pyx_t_7 = 0;
15896  __Pyx_INCREF(__pyx_t_3);
15897  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
15898  __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 674, __pyx_L1_error)
15899  __Pyx_GOTREF(__pyx_t_7);
15900  __Pyx_DECREF(__pyx_t_3);
15901  __pyx_t_3 = __pyx_t_7;
15902  __pyx_t_7 = 0;
15903 
15904  /* "View.MemoryView":675
15905  * seen_ellipsis = False
15906  * for idx, item in enumerate(tup):
15907  * if item is Ellipsis: # <<<<<<<<<<<<<<
15908  * if not seen_ellipsis:
15909  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15910  */
15911  __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
15912  __pyx_t_1 = (__pyx_t_2 != 0);
15913  if (__pyx_t_1) {
15914 
15915  /* "View.MemoryView":676
15916  * for idx, item in enumerate(tup):
15917  * if item is Ellipsis:
15918  * if not seen_ellipsis: # <<<<<<<<<<<<<<
15919  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15920  * seen_ellipsis = True
15921  */
15922  __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
15923  if (__pyx_t_1) {
15924 
15925  /* "View.MemoryView":677
15926  * if item is Ellipsis:
15927  * if not seen_ellipsis:
15928  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
15929  * seen_ellipsis = True
15930  * else:
15931  */
15932  __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 677, __pyx_L1_error)
15933  __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 677, __pyx_L1_error)
15934  __Pyx_GOTREF(__pyx_t_7);
15935  { Py_ssize_t __pyx_temp;
15936  for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
15937  __Pyx_INCREF(__pyx_slice__29);
15938  __Pyx_GIVEREF(__pyx_slice__29);
15939  PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__29);
15940  }
15941  }
15942  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 677, __pyx_L1_error)
15943  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15944 
15945  /* "View.MemoryView":678
15946  * if not seen_ellipsis:
15947  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15948  * seen_ellipsis = True # <<<<<<<<<<<<<<
15949  * else:
15950  * result.append(slice(None))
15951  */
15952  __pyx_v_seen_ellipsis = 1;
15953 
15954  /* "View.MemoryView":676
15955  * for idx, item in enumerate(tup):
15956  * if item is Ellipsis:
15957  * if not seen_ellipsis: # <<<<<<<<<<<<<<
15958  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15959  * seen_ellipsis = True
15960  */
15961  goto __pyx_L7;
15962  }
15963 
15964  /* "View.MemoryView":680
15965  * seen_ellipsis = True
15966  * else:
15967  * result.append(slice(None)) # <<<<<<<<<<<<<<
15968  * have_slices = True
15969  * else:
15970  */
15971  /*else*/ {
15972  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__30); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 680, __pyx_L1_error)
15973  }
15974  __pyx_L7:;
15975 
15976  /* "View.MemoryView":681
15977  * else:
15978  * result.append(slice(None))
15979  * have_slices = True # <<<<<<<<<<<<<<
15980  * else:
15981  * if not isinstance(item, slice) and not PyIndex_Check(item):
15982  */
15983  __pyx_v_have_slices = 1;
15984 
15985  /* "View.MemoryView":675
15986  * seen_ellipsis = False
15987  * for idx, item in enumerate(tup):
15988  * if item is Ellipsis: # <<<<<<<<<<<<<<
15989  * if not seen_ellipsis:
15990  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15991  */
15992  goto __pyx_L6;
15993  }
15994 
15995  /* "View.MemoryView":683
15996  * have_slices = True
15997  * else:
15998  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
15999  * raise TypeError("Cannot index with type '%s'" % type(item))
16000  *
16001  */
16002  /*else*/ {
16003  __pyx_t_2 = PySlice_Check(__pyx_v_item);
16004  __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
16005  if (__pyx_t_10) {
16006  } else {
16007  __pyx_t_1 = __pyx_t_10;
16008  goto __pyx_L9_bool_binop_done;
16009  }
16010  __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
16011  __pyx_t_1 = __pyx_t_10;
16012  __pyx_L9_bool_binop_done:;
16013  if (unlikely(__pyx_t_1)) {
16014 
16015  /* "View.MemoryView":684
16016  * else:
16017  * if not isinstance(item, slice) and not PyIndex_Check(item):
16018  * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<<
16019  *
16020  * have_slices = have_slices or isinstance(item, slice)
16021  */
16022  __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 684, __pyx_L1_error)
16023  __Pyx_GOTREF(__pyx_t_7);
16024  __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 684, __pyx_L1_error)
16025  __Pyx_GOTREF(__pyx_t_11);
16026  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16027  __Pyx_Raise(__pyx_t_11, 0, 0, 0);
16028  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
16029  __PYX_ERR(1, 684, __pyx_L1_error)
16030 
16031  /* "View.MemoryView":683
16032  * have_slices = True
16033  * else:
16034  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
16035  * raise TypeError("Cannot index with type '%s'" % type(item))
16036  *
16037  */
16038  }
16039 
16040  /* "View.MemoryView":686
16041  * raise TypeError("Cannot index with type '%s'" % type(item))
16042  *
16043  * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
16044  * result.append(item)
16045  *
16046  */
16047  __pyx_t_10 = (__pyx_v_have_slices != 0);
16048  if (!__pyx_t_10) {
16049  } else {
16050  __pyx_t_1 = __pyx_t_10;
16051  goto __pyx_L11_bool_binop_done;
16052  }
16053  __pyx_t_10 = PySlice_Check(__pyx_v_item);
16054  __pyx_t_2 = (__pyx_t_10 != 0);
16055  __pyx_t_1 = __pyx_t_2;
16056  __pyx_L11_bool_binop_done:;
16057  __pyx_v_have_slices = __pyx_t_1;
16058 
16059  /* "View.MemoryView":687
16060  *
16061  * have_slices = have_slices or isinstance(item, slice)
16062  * result.append(item) # <<<<<<<<<<<<<<
16063  *
16064  * nslices = ndim - len(result)
16065  */
16066  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 687, __pyx_L1_error)
16067  }
16068  __pyx_L6:;
16069 
16070  /* "View.MemoryView":674
16071  * have_slices = False
16072  * seen_ellipsis = False
16073  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
16074  * if item is Ellipsis:
16075  * if not seen_ellipsis:
16076  */
16077  }
16078  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16079  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16080 
16081  /* "View.MemoryView":689
16082  * result.append(item)
16083  *
16084  * nslices = ndim - len(result) # <<<<<<<<<<<<<<
16085  * if nslices:
16086  * result.extend([slice(None)] * nslices)
16087  */
16088  __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 689, __pyx_L1_error)
16089  __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
16090 
16091  /* "View.MemoryView":690
16092  *
16093  * nslices = ndim - len(result)
16094  * if nslices: # <<<<<<<<<<<<<<
16095  * result.extend([slice(None)] * nslices)
16096  *
16097  */
16098  __pyx_t_1 = (__pyx_v_nslices != 0);
16099  if (__pyx_t_1) {
16100 
16101  /* "View.MemoryView":691
16102  * nslices = ndim - len(result)
16103  * if nslices:
16104  * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
16105  *
16106  * return have_slices or nslices, tuple(result)
16107  */
16108  __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 691, __pyx_L1_error)
16109  __Pyx_GOTREF(__pyx_t_3);
16110  { Py_ssize_t __pyx_temp;
16111  for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
16112  __Pyx_INCREF(__pyx_slice__31);
16113  __Pyx_GIVEREF(__pyx_slice__31);
16114  PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__31);
16115  }
16116  }
16117  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 691, __pyx_L1_error)
16118  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16119 
16120  /* "View.MemoryView":690
16121  *
16122  * nslices = ndim - len(result)
16123  * if nslices: # <<<<<<<<<<<<<<
16124  * result.extend([slice(None)] * nslices)
16125  *
16126  */
16127  }
16128 
16129  /* "View.MemoryView":693
16130  * result.extend([slice(None)] * nslices)
16131  *
16132  * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
16133  *
16134  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
16135  */
16136  __Pyx_XDECREF(__pyx_r);
16137  if (!__pyx_v_have_slices) {
16138  } else {
16139  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 693, __pyx_L1_error)
16140  __Pyx_GOTREF(__pyx_t_4);
16141  __pyx_t_3 = __pyx_t_4;
16142  __pyx_t_4 = 0;
16143  goto __pyx_L14_bool_binop_done;
16144  }
16145  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 693, __pyx_L1_error)
16146  __Pyx_GOTREF(__pyx_t_4);
16147  __pyx_t_3 = __pyx_t_4;
16148  __pyx_t_4 = 0;
16149  __pyx_L14_bool_binop_done:;
16150  __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 693, __pyx_L1_error)
16151  __Pyx_GOTREF(__pyx_t_4);
16152  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 693, __pyx_L1_error)
16153  __Pyx_GOTREF(__pyx_t_11);
16154  __Pyx_GIVEREF(__pyx_t_3);
16155  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
16156  __Pyx_GIVEREF(__pyx_t_4);
16157  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
16158  __pyx_t_3 = 0;
16159  __pyx_t_4 = 0;
16160  __pyx_r = ((PyObject*)__pyx_t_11);
16161  __pyx_t_11 = 0;
16162  goto __pyx_L0;
16163 
16164  /* "View.MemoryView":661
16165  * return isinstance(o, memoryview)
16166  *
16167  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
16168  * """
16169  * Replace all ellipses with full slices and fill incomplete indices with
16170  */
16171 
16172  /* function exit code */
16173  __pyx_L1_error:;
16174  __Pyx_XDECREF(__pyx_t_3);
16175  __Pyx_XDECREF(__pyx_t_4);
16176  __Pyx_XDECREF(__pyx_t_7);
16177  __Pyx_XDECREF(__pyx_t_11);
16178  __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
16179  __pyx_r = 0;
16180  __pyx_L0:;
16181  __Pyx_XDECREF(__pyx_v_tup);
16182  __Pyx_XDECREF(__pyx_v_result);
16183  __Pyx_XDECREF(__pyx_v_idx);
16184  __Pyx_XDECREF(__pyx_v_item);
16185  __Pyx_XGIVEREF(__pyx_r);
16186  __Pyx_RefNannyFinishContext();
16187  return __pyx_r;
16188 }
16189 
16190 /* "View.MemoryView":695
16191  * return have_slices or nslices, tuple(result)
16192  *
16193  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
16194  * for suboffset in suboffsets[:ndim]:
16195  * if suboffset >= 0:
16196  */
16197 
16198 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
16199  Py_ssize_t __pyx_v_suboffset;
16200  PyObject *__pyx_r = NULL;
16201  __Pyx_RefNannyDeclarations
16202  Py_ssize_t *__pyx_t_1;
16203  Py_ssize_t *__pyx_t_2;
16204  Py_ssize_t *__pyx_t_3;
16205  int __pyx_t_4;
16206  PyObject *__pyx_t_5 = NULL;
16207  __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
16208 
16209  /* "View.MemoryView":696
16210  *
16211  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
16212  * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
16213  * if suboffset >= 0:
16214  * raise ValueError("Indirect dimensions not supported")
16215  */
16216  __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
16217  for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
16218  __pyx_t_1 = __pyx_t_3;
16219  __pyx_v_suboffset = (__pyx_t_1[0]);
16220 
16221  /* "View.MemoryView":697
16222  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
16223  * for suboffset in suboffsets[:ndim]:
16224  * if suboffset >= 0: # <<<<<<<<<<<<<<
16225  * raise ValueError("Indirect dimensions not supported")
16226  *
16227  */
16228  __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
16229  if (unlikely(__pyx_t_4)) {
16230 
16231  /* "View.MemoryView":698
16232  * for suboffset in suboffsets[:ndim]:
16233  * if suboffset >= 0:
16234  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
16235  *
16236  *
16237  */
16238  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 698, __pyx_L1_error)
16239  __Pyx_GOTREF(__pyx_t_5);
16240  __Pyx_Raise(__pyx_t_5, 0, 0, 0);
16241  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16242  __PYX_ERR(1, 698, __pyx_L1_error)
16243 
16244  /* "View.MemoryView":697
16245  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
16246  * for suboffset in suboffsets[:ndim]:
16247  * if suboffset >= 0: # <<<<<<<<<<<<<<
16248  * raise ValueError("Indirect dimensions not supported")
16249  *
16250  */
16251  }
16252  }
16253 
16254  /* "View.MemoryView":695
16255  * return have_slices or nslices, tuple(result)
16256  *
16257  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
16258  * for suboffset in suboffsets[:ndim]:
16259  * if suboffset >= 0:
16260  */
16261 
16262  /* function exit code */
16263  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16264  goto __pyx_L0;
16265  __pyx_L1_error:;
16266  __Pyx_XDECREF(__pyx_t_5);
16267  __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
16268  __pyx_r = 0;
16269  __pyx_L0:;
16270  __Pyx_XGIVEREF(__pyx_r);
16271  __Pyx_RefNannyFinishContext();
16272  return __pyx_r;
16273 }
16274 
16275 /* "View.MemoryView":705
16276  *
16277  * @cname('__pyx_memview_slice')
16278  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
16279  * cdef int new_ndim = 0, suboffset_dim = -1, dim
16280  * cdef bint negative_step
16281  */
16282 
16283 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
16284  int __pyx_v_new_ndim;
16285  int __pyx_v_suboffset_dim;
16286  int __pyx_v_dim;
16287  __Pyx_memviewslice __pyx_v_src;
16288  __Pyx_memviewslice __pyx_v_dst;
16289  __Pyx_memviewslice *__pyx_v_p_src;
16290  struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
16291  __Pyx_memviewslice *__pyx_v_p_dst;
16292  int *__pyx_v_p_suboffset_dim;
16293  Py_ssize_t __pyx_v_start;
16294  Py_ssize_t __pyx_v_stop;
16295  Py_ssize_t __pyx_v_step;
16296  int __pyx_v_have_start;
16297  int __pyx_v_have_stop;
16298  int __pyx_v_have_step;
16299  PyObject *__pyx_v_index = NULL;
16300  struct __pyx_memoryview_obj *__pyx_r = NULL;
16301  __Pyx_RefNannyDeclarations
16302  int __pyx_t_1;
16303  int __pyx_t_2;
16304  PyObject *__pyx_t_3 = NULL;
16305  struct __pyx_memoryview_obj *__pyx_t_4;
16306  char *__pyx_t_5;
16307  int __pyx_t_6;
16308  Py_ssize_t __pyx_t_7;
16309  PyObject *(*__pyx_t_8)(PyObject *);
16310  PyObject *__pyx_t_9 = NULL;
16311  Py_ssize_t __pyx_t_10;
16312  int __pyx_t_11;
16313  Py_ssize_t __pyx_t_12;
16314  __Pyx_RefNannySetupContext("memview_slice", 0);
16315 
16316  /* "View.MemoryView":706
16317  * @cname('__pyx_memview_slice')
16318  * cdef memoryview memview_slice(memoryview memview, object indices):
16319  * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
16320  * cdef bint negative_step
16321  * cdef __Pyx_memviewslice src, dst
16322  */
16323  __pyx_v_new_ndim = 0;
16324  __pyx_v_suboffset_dim = -1;
16325 
16326  /* "View.MemoryView":713
16327  *
16328  *
16329  * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
16330  *
16331  * cdef _memoryviewslice memviewsliceobj
16332  */
16333  (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
16334 
16335  /* "View.MemoryView":717
16336  * cdef _memoryviewslice memviewsliceobj
16337  *
16338  * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
16339  *
16340  * if isinstance(memview, _memoryviewslice):
16341  */
16342  #ifndef CYTHON_WITHOUT_ASSERTIONS
16343  if (unlikely(!Py_OptimizeFlag)) {
16344  if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
16345  PyErr_SetNone(PyExc_AssertionError);
16346  __PYX_ERR(1, 717, __pyx_L1_error)
16347  }
16348  }
16349  #endif
16350 
16351  /* "View.MemoryView":719
16352  * assert memview.view.ndim > 0
16353  *
16354  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16355  * memviewsliceobj = memview
16356  * p_src = &memviewsliceobj.from_slice
16357  */
16358  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
16359  __pyx_t_2 = (__pyx_t_1 != 0);
16360  if (__pyx_t_2) {
16361 
16362  /* "View.MemoryView":720
16363  *
16364  * if isinstance(memview, _memoryviewslice):
16365  * memviewsliceobj = memview # <<<<<<<<<<<<<<
16366  * p_src = &memviewsliceobj.from_slice
16367  * else:
16368  */
16369  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 720, __pyx_L1_error)
16370  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
16371  __Pyx_INCREF(__pyx_t_3);
16372  __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
16373  __pyx_t_3 = 0;
16374 
16375  /* "View.MemoryView":721
16376  * if isinstance(memview, _memoryviewslice):
16377  * memviewsliceobj = memview
16378  * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
16379  * else:
16380  * slice_copy(memview, &src)
16381  */
16382  __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
16383 
16384  /* "View.MemoryView":719
16385  * assert memview.view.ndim > 0
16386  *
16387  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16388  * memviewsliceobj = memview
16389  * p_src = &memviewsliceobj.from_slice
16390  */
16391  goto __pyx_L3;
16392  }
16393 
16394  /* "View.MemoryView":723
16395  * p_src = &memviewsliceobj.from_slice
16396  * else:
16397  * slice_copy(memview, &src) # <<<<<<<<<<<<<<
16398  * p_src = &src
16399  *
16400  */
16401  /*else*/ {
16402  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
16403 
16404  /* "View.MemoryView":724
16405  * else:
16406  * slice_copy(memview, &src)
16407  * p_src = &src # <<<<<<<<<<<<<<
16408  *
16409  *
16410  */
16411  __pyx_v_p_src = (&__pyx_v_src);
16412  }
16413  __pyx_L3:;
16414 
16415  /* "View.MemoryView":730
16416  *
16417  *
16418  * dst.memview = p_src.memview # <<<<<<<<<<<<<<
16419  * dst.data = p_src.data
16420  *
16421  */
16422  __pyx_t_4 = __pyx_v_p_src->memview;
16423  __pyx_v_dst.memview = __pyx_t_4;
16424 
16425  /* "View.MemoryView":731
16426  *
16427  * dst.memview = p_src.memview
16428  * dst.data = p_src.data # <<<<<<<<<<<<<<
16429  *
16430  *
16431  */
16432  __pyx_t_5 = __pyx_v_p_src->data;
16433  __pyx_v_dst.data = __pyx_t_5;
16434 
16435  /* "View.MemoryView":736
16436  *
16437  *
16438  * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
16439  * cdef int *p_suboffset_dim = &suboffset_dim
16440  * cdef Py_ssize_t start, stop, step
16441  */
16442  __pyx_v_p_dst = (&__pyx_v_dst);
16443 
16444  /* "View.MemoryView":737
16445  *
16446  * cdef __Pyx_memviewslice *p_dst = &dst
16447  * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
16448  * cdef Py_ssize_t start, stop, step
16449  * cdef bint have_start, have_stop, have_step
16450  */
16451  __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
16452 
16453  /* "View.MemoryView":741
16454  * cdef bint have_start, have_stop, have_step
16455  *
16456  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
16457  * if PyIndex_Check(index):
16458  * slice_memviewslice(
16459  */
16460  __pyx_t_6 = 0;
16461  if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
16462  __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
16463  __pyx_t_8 = NULL;
16464  } else {
16465  __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 741, __pyx_L1_error)
16466  __Pyx_GOTREF(__pyx_t_3);
16467  __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 741, __pyx_L1_error)
16468  }
16469  for (;;) {
16470  if (likely(!__pyx_t_8)) {
16471  if (likely(PyList_CheckExact(__pyx_t_3))) {
16472  if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
16473  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16474  __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 741, __pyx_L1_error)
16475  #else
16476  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 741, __pyx_L1_error)
16477  __Pyx_GOTREF(__pyx_t_9);
16478  #endif
16479  } else {
16480  if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
16481  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16482  __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 741, __pyx_L1_error)
16483  #else
16484  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 741, __pyx_L1_error)
16485  __Pyx_GOTREF(__pyx_t_9);
16486  #endif
16487  }
16488  } else {
16489  __pyx_t_9 = __pyx_t_8(__pyx_t_3);
16490  if (unlikely(!__pyx_t_9)) {
16491  PyObject* exc_type = PyErr_Occurred();
16492  if (exc_type) {
16493  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
16494  else __PYX_ERR(1, 741, __pyx_L1_error)
16495  }
16496  break;
16497  }
16498  __Pyx_GOTREF(__pyx_t_9);
16499  }
16500  __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
16501  __pyx_t_9 = 0;
16502  __pyx_v_dim = __pyx_t_6;
16503  __pyx_t_6 = (__pyx_t_6 + 1);
16504 
16505  /* "View.MemoryView":742
16506  *
16507  * for dim, index in enumerate(indices):
16508  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
16509  * slice_memviewslice(
16510  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
16511  */
16512  __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
16513  if (__pyx_t_2) {
16514 
16515  /* "View.MemoryView":746
16516  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
16517  * dim, new_ndim, p_suboffset_dim,
16518  * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<<
16519  * 0, 0, 0, # have_{start,stop,step}
16520  * False)
16521  */
16522  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 746, __pyx_L1_error)
16523 
16524  /* "View.MemoryView":743
16525  * for dim, index in enumerate(indices):
16526  * if PyIndex_Check(index):
16527  * slice_memviewslice( # <<<<<<<<<<<<<<
16528  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
16529  * dim, new_ndim, p_suboffset_dim,
16530  */
16531  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 743, __pyx_L1_error)
16532 
16533  /* "View.MemoryView":742
16534  *
16535  * for dim, index in enumerate(indices):
16536  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
16537  * slice_memviewslice(
16538  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
16539  */
16540  goto __pyx_L6;
16541  }
16542 
16543  /* "View.MemoryView":749
16544  * 0, 0, 0, # have_{start,stop,step}
16545  * False)
16546  * elif index is None: # <<<<<<<<<<<<<<
16547  * p_dst.shape[new_ndim] = 1
16548  * p_dst.strides[new_ndim] = 0
16549  */
16550  __pyx_t_2 = (__pyx_v_index == Py_None);
16551  __pyx_t_1 = (__pyx_t_2 != 0);
16552  if (__pyx_t_1) {
16553 
16554  /* "View.MemoryView":750
16555  * False)
16556  * elif index is None:
16557  * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
16558  * p_dst.strides[new_ndim] = 0
16559  * p_dst.suboffsets[new_ndim] = -1
16560  */
16561  (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
16562 
16563  /* "View.MemoryView":751
16564  * elif index is None:
16565  * p_dst.shape[new_ndim] = 1
16566  * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
16567  * p_dst.suboffsets[new_ndim] = -1
16568  * new_ndim += 1
16569  */
16570  (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
16571 
16572  /* "View.MemoryView":752
16573  * p_dst.shape[new_ndim] = 1
16574  * p_dst.strides[new_ndim] = 0
16575  * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
16576  * new_ndim += 1
16577  * else:
16578  */
16579  (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
16580 
16581  /* "View.MemoryView":753
16582  * p_dst.strides[new_ndim] = 0
16583  * p_dst.suboffsets[new_ndim] = -1
16584  * new_ndim += 1 # <<<<<<<<<<<<<<
16585  * else:
16586  * start = index.start or 0
16587  */
16588  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
16589 
16590  /* "View.MemoryView":749
16591  * 0, 0, 0, # have_{start,stop,step}
16592  * False)
16593  * elif index is None: # <<<<<<<<<<<<<<
16594  * p_dst.shape[new_ndim] = 1
16595  * p_dst.strides[new_ndim] = 0
16596  */
16597  goto __pyx_L6;
16598  }
16599 
16600  /* "View.MemoryView":755
16601  * new_ndim += 1
16602  * else:
16603  * start = index.start or 0 # <<<<<<<<<<<<<<
16604  * stop = index.stop or 0
16605  * step = index.step or 0
16606  */
16607  /*else*/ {
16608  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 755, __pyx_L1_error)
16609  __Pyx_GOTREF(__pyx_t_9);
16610  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 755, __pyx_L1_error)
16611  if (!__pyx_t_1) {
16612  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16613  } else {
16614  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 755, __pyx_L1_error)
16615  __pyx_t_10 = __pyx_t_12;
16616  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16617  goto __pyx_L7_bool_binop_done;
16618  }
16619  __pyx_t_10 = 0;
16620  __pyx_L7_bool_binop_done:;
16621  __pyx_v_start = __pyx_t_10;
16622 
16623  /* "View.MemoryView":756
16624  * else:
16625  * start = index.start or 0
16626  * stop = index.stop or 0 # <<<<<<<<<<<<<<
16627  * step = index.step or 0
16628  *
16629  */
16630  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 756, __pyx_L1_error)
16631  __Pyx_GOTREF(__pyx_t_9);
16632  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 756, __pyx_L1_error)
16633  if (!__pyx_t_1) {
16634  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16635  } else {
16636  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 756, __pyx_L1_error)
16637  __pyx_t_10 = __pyx_t_12;
16638  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16639  goto __pyx_L9_bool_binop_done;
16640  }
16641  __pyx_t_10 = 0;
16642  __pyx_L9_bool_binop_done:;
16643  __pyx_v_stop = __pyx_t_10;
16644 
16645  /* "View.MemoryView":757
16646  * start = index.start or 0
16647  * stop = index.stop or 0
16648  * step = index.step or 0 # <<<<<<<<<<<<<<
16649  *
16650  * have_start = index.start is not None
16651  */
16652  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 757, __pyx_L1_error)
16653  __Pyx_GOTREF(__pyx_t_9);
16654  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 757, __pyx_L1_error)
16655  if (!__pyx_t_1) {
16656  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16657  } else {
16658  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 757, __pyx_L1_error)
16659  __pyx_t_10 = __pyx_t_12;
16660  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16661  goto __pyx_L11_bool_binop_done;
16662  }
16663  __pyx_t_10 = 0;
16664  __pyx_L11_bool_binop_done:;
16665  __pyx_v_step = __pyx_t_10;
16666 
16667  /* "View.MemoryView":759
16668  * step = index.step or 0
16669  *
16670  * have_start = index.start is not None # <<<<<<<<<<<<<<
16671  * have_stop = index.stop is not None
16672  * have_step = index.step is not None
16673  */
16674  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 759, __pyx_L1_error)
16675  __Pyx_GOTREF(__pyx_t_9);
16676  __pyx_t_1 = (__pyx_t_9 != Py_None);
16677  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16678  __pyx_v_have_start = __pyx_t_1;
16679 
16680  /* "View.MemoryView":760
16681  *
16682  * have_start = index.start is not None
16683  * have_stop = index.stop is not None # <<<<<<<<<<<<<<
16684  * have_step = index.step is not None
16685  *
16686  */
16687  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 760, __pyx_L1_error)
16688  __Pyx_GOTREF(__pyx_t_9);
16689  __pyx_t_1 = (__pyx_t_9 != Py_None);
16690  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16691  __pyx_v_have_stop = __pyx_t_1;
16692 
16693  /* "View.MemoryView":761
16694  * have_start = index.start is not None
16695  * have_stop = index.stop is not None
16696  * have_step = index.step is not None # <<<<<<<<<<<<<<
16697  *
16698  * slice_memviewslice(
16699  */
16700  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 761, __pyx_L1_error)
16701  __Pyx_GOTREF(__pyx_t_9);
16702  __pyx_t_1 = (__pyx_t_9 != Py_None);
16703  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16704  __pyx_v_have_step = __pyx_t_1;
16705 
16706  /* "View.MemoryView":763
16707  * have_step = index.step is not None
16708  *
16709  * slice_memviewslice( # <<<<<<<<<<<<<<
16710  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
16711  * dim, new_ndim, p_suboffset_dim,
16712  */
16713  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 763, __pyx_L1_error)
16714 
16715  /* "View.MemoryView":769
16716  * have_start, have_stop, have_step,
16717  * True)
16718  * new_ndim += 1 # <<<<<<<<<<<<<<
16719  *
16720  * if isinstance(memview, _memoryviewslice):
16721  */
16722  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
16723  }
16724  __pyx_L6:;
16725 
16726  /* "View.MemoryView":741
16727  * cdef bint have_start, have_stop, have_step
16728  *
16729  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
16730  * if PyIndex_Check(index):
16731  * slice_memviewslice(
16732  */
16733  }
16734  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16735 
16736  /* "View.MemoryView":771
16737  * new_ndim += 1
16738  *
16739  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16740  * return memoryview_fromslice(dst, new_ndim,
16741  * memviewsliceobj.to_object_func,
16742  */
16743  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
16744  __pyx_t_2 = (__pyx_t_1 != 0);
16745  if (__pyx_t_2) {
16746 
16747  /* "View.MemoryView":772
16748  *
16749  * if isinstance(memview, _memoryviewslice):
16750  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
16751  * memviewsliceobj.to_object_func,
16752  * memviewsliceobj.to_dtype_func,
16753  */
16754  __Pyx_XDECREF(((PyObject *)__pyx_r));
16755 
16756  /* "View.MemoryView":773
16757  * if isinstance(memview, _memoryviewslice):
16758  * return memoryview_fromslice(dst, new_ndim,
16759  * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
16760  * memviewsliceobj.to_dtype_func,
16761  * memview.dtype_is_object)
16762  */
16763  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 773, __pyx_L1_error) }
16764 
16765  /* "View.MemoryView":774
16766  * return memoryview_fromslice(dst, new_ndim,
16767  * memviewsliceobj.to_object_func,
16768  * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
16769  * memview.dtype_is_object)
16770  * else:
16771  */
16772  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 774, __pyx_L1_error) }
16773 
16774  /* "View.MemoryView":772
16775  *
16776  * if isinstance(memview, _memoryviewslice):
16777  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
16778  * memviewsliceobj.to_object_func,
16779  * memviewsliceobj.to_dtype_func,
16780  */
16781  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 772, __pyx_L1_error)
16782  __Pyx_GOTREF(__pyx_t_3);
16783  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 772, __pyx_L1_error)
16784  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
16785  __pyx_t_3 = 0;
16786  goto __pyx_L0;
16787 
16788  /* "View.MemoryView":771
16789  * new_ndim += 1
16790  *
16791  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16792  * return memoryview_fromslice(dst, new_ndim,
16793  * memviewsliceobj.to_object_func,
16794  */
16795  }
16796 
16797  /* "View.MemoryView":777
16798  * memview.dtype_is_object)
16799  * else:
16800  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
16801  * memview.dtype_is_object)
16802  *
16803  */
16804  /*else*/ {
16805  __Pyx_XDECREF(((PyObject *)__pyx_r));
16806 
16807  /* "View.MemoryView":778
16808  * else:
16809  * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
16810  * memview.dtype_is_object) # <<<<<<<<<<<<<<
16811  *
16812  *
16813  */
16814  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 777, __pyx_L1_error)
16815  __Pyx_GOTREF(__pyx_t_3);
16816 
16817  /* "View.MemoryView":777
16818  * memview.dtype_is_object)
16819  * else:
16820  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
16821  * memview.dtype_is_object)
16822  *
16823  */
16824  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 777, __pyx_L1_error)
16825  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
16826  __pyx_t_3 = 0;
16827  goto __pyx_L0;
16828  }
16829 
16830  /* "View.MemoryView":705
16831  *
16832  * @cname('__pyx_memview_slice')
16833  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
16834  * cdef int new_ndim = 0, suboffset_dim = -1, dim
16835  * cdef bint negative_step
16836  */
16837 
16838  /* function exit code */
16839  __pyx_L1_error:;
16840  __Pyx_XDECREF(__pyx_t_3);
16841  __Pyx_XDECREF(__pyx_t_9);
16842  __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16843  __pyx_r = 0;
16844  __pyx_L0:;
16845  __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
16846  __Pyx_XDECREF(__pyx_v_index);
16847  __Pyx_XGIVEREF((PyObject *)__pyx_r);
16848  __Pyx_RefNannyFinishContext();
16849  return __pyx_r;
16850 }
16851 
16852 /* "View.MemoryView":802
16853  *
16854  * @cname('__pyx_memoryview_slice_memviewslice')
16855  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
16856  * __Pyx_memviewslice *dst,
16857  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
16858  */
16859 
16860 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
16861  Py_ssize_t __pyx_v_new_shape;
16862  int __pyx_v_negative_step;
16863  int __pyx_r;
16864  int __pyx_t_1;
16865  int __pyx_t_2;
16866  int __pyx_t_3;
16867 
16868  /* "View.MemoryView":822
16869  * cdef bint negative_step
16870  *
16871  * if not is_slice: # <<<<<<<<<<<<<<
16872  *
16873  * if start < 0:
16874  */
16875  __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
16876  if (__pyx_t_1) {
16877 
16878  /* "View.MemoryView":824
16879  * if not is_slice:
16880  *
16881  * if start < 0: # <<<<<<<<<<<<<<
16882  * start += shape
16883  * if not 0 <= start < shape:
16884  */
16885  __pyx_t_1 = ((__pyx_v_start < 0) != 0);
16886  if (__pyx_t_1) {
16887 
16888  /* "View.MemoryView":825
16889  *
16890  * if start < 0:
16891  * start += shape # <<<<<<<<<<<<<<
16892  * if not 0 <= start < shape:
16893  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
16894  */
16895  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
16896 
16897  /* "View.MemoryView":824
16898  * if not is_slice:
16899  *
16900  * if start < 0: # <<<<<<<<<<<<<<
16901  * start += shape
16902  * if not 0 <= start < shape:
16903  */
16904  }
16905 
16906  /* "View.MemoryView":826
16907  * if start < 0:
16908  * start += shape
16909  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
16910  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
16911  * else:
16912  */
16913  __pyx_t_1 = (0 <= __pyx_v_start);
16914  if (__pyx_t_1) {
16915  __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
16916  }
16917  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
16918  if (__pyx_t_2) {
16919 
16920  /* "View.MemoryView":827
16921  * start += shape
16922  * if not 0 <= start < shape:
16923  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
16924  * else:
16925  *
16926  */
16927  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 827, __pyx_L1_error)
16928 
16929  /* "View.MemoryView":826
16930  * if start < 0:
16931  * start += shape
16932  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
16933  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
16934  * else:
16935  */
16936  }
16937 
16938  /* "View.MemoryView":822
16939  * cdef bint negative_step
16940  *
16941  * if not is_slice: # <<<<<<<<<<<<<<
16942  *
16943  * if start < 0:
16944  */
16945  goto __pyx_L3;
16946  }
16947 
16948  /* "View.MemoryView":830
16949  * else:
16950  *
16951  * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
16952  *
16953  * if have_step and step == 0:
16954  */
16955  /*else*/ {
16956  __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
16957  if (__pyx_t_1) {
16958  } else {
16959  __pyx_t_2 = __pyx_t_1;
16960  goto __pyx_L6_bool_binop_done;
16961  }
16962  __pyx_t_1 = ((__pyx_v_step < 0) != 0);
16963  __pyx_t_2 = __pyx_t_1;
16964  __pyx_L6_bool_binop_done:;
16965  __pyx_v_negative_step = __pyx_t_2;
16966 
16967  /* "View.MemoryView":832
16968  * negative_step = have_step != 0 and step < 0
16969  *
16970  * if have_step and step == 0: # <<<<<<<<<<<<<<
16971  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
16972  *
16973  */
16974  __pyx_t_1 = (__pyx_v_have_step != 0);
16975  if (__pyx_t_1) {
16976  } else {
16977  __pyx_t_2 = __pyx_t_1;
16978  goto __pyx_L9_bool_binop_done;
16979  }
16980  __pyx_t_1 = ((__pyx_v_step == 0) != 0);
16981  __pyx_t_2 = __pyx_t_1;
16982  __pyx_L9_bool_binop_done:;
16983  if (__pyx_t_2) {
16984 
16985  /* "View.MemoryView":833
16986  *
16987  * if have_step and step == 0:
16988  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
16989  *
16990  *
16991  */
16992  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 833, __pyx_L1_error)
16993 
16994  /* "View.MemoryView":832
16995  * negative_step = have_step != 0 and step < 0
16996  *
16997  * if have_step and step == 0: # <<<<<<<<<<<<<<
16998  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
16999  *
17000  */
17001  }
17002 
17003  /* "View.MemoryView":836
17004  *
17005  *
17006  * if have_start: # <<<<<<<<<<<<<<
17007  * if start < 0:
17008  * start += shape
17009  */
17010  __pyx_t_2 = (__pyx_v_have_start != 0);
17011  if (__pyx_t_2) {
17012 
17013  /* "View.MemoryView":837
17014  *
17015  * if have_start:
17016  * if start < 0: # <<<<<<<<<<<<<<
17017  * start += shape
17018  * if start < 0:
17019  */
17020  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
17021  if (__pyx_t_2) {
17022 
17023  /* "View.MemoryView":838
17024  * if have_start:
17025  * if start < 0:
17026  * start += shape # <<<<<<<<<<<<<<
17027  * if start < 0:
17028  * start = 0
17029  */
17030  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
17031 
17032  /* "View.MemoryView":839
17033  * if start < 0:
17034  * start += shape
17035  * if start < 0: # <<<<<<<<<<<<<<
17036  * start = 0
17037  * elif start >= shape:
17038  */
17039  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
17040  if (__pyx_t_2) {
17041 
17042  /* "View.MemoryView":840
17043  * start += shape
17044  * if start < 0:
17045  * start = 0 # <<<<<<<<<<<<<<
17046  * elif start >= shape:
17047  * if negative_step:
17048  */
17049  __pyx_v_start = 0;
17050 
17051  /* "View.MemoryView":839
17052  * if start < 0:
17053  * start += shape
17054  * if start < 0: # <<<<<<<<<<<<<<
17055  * start = 0
17056  * elif start >= shape:
17057  */
17058  }
17059 
17060  /* "View.MemoryView":837
17061  *
17062  * if have_start:
17063  * if start < 0: # <<<<<<<<<<<<<<
17064  * start += shape
17065  * if start < 0:
17066  */
17067  goto __pyx_L12;
17068  }
17069 
17070  /* "View.MemoryView":841
17071  * if start < 0:
17072  * start = 0
17073  * elif start >= shape: # <<<<<<<<<<<<<<
17074  * if negative_step:
17075  * start = shape - 1
17076  */
17077  __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
17078  if (__pyx_t_2) {
17079 
17080  /* "View.MemoryView":842
17081  * start = 0
17082  * elif start >= shape:
17083  * if negative_step: # <<<<<<<<<<<<<<
17084  * start = shape - 1
17085  * else:
17086  */
17087  __pyx_t_2 = (__pyx_v_negative_step != 0);
17088  if (__pyx_t_2) {
17089 
17090  /* "View.MemoryView":843
17091  * elif start >= shape:
17092  * if negative_step:
17093  * start = shape - 1 # <<<<<<<<<<<<<<
17094  * else:
17095  * start = shape
17096  */
17097  __pyx_v_start = (__pyx_v_shape - 1);
17098 
17099  /* "View.MemoryView":842
17100  * start = 0
17101  * elif start >= shape:
17102  * if negative_step: # <<<<<<<<<<<<<<
17103  * start = shape - 1
17104  * else:
17105  */
17106  goto __pyx_L14;
17107  }
17108 
17109  /* "View.MemoryView":845
17110  * start = shape - 1
17111  * else:
17112  * start = shape # <<<<<<<<<<<<<<
17113  * else:
17114  * if negative_step:
17115  */
17116  /*else*/ {
17117  __pyx_v_start = __pyx_v_shape;
17118  }
17119  __pyx_L14:;
17120 
17121  /* "View.MemoryView":841
17122  * if start < 0:
17123  * start = 0
17124  * elif start >= shape: # <<<<<<<<<<<<<<
17125  * if negative_step:
17126  * start = shape - 1
17127  */
17128  }
17129  __pyx_L12:;
17130 
17131  /* "View.MemoryView":836
17132  *
17133  *
17134  * if have_start: # <<<<<<<<<<<<<<
17135  * if start < 0:
17136  * start += shape
17137  */
17138  goto __pyx_L11;
17139  }
17140 
17141  /* "View.MemoryView":847
17142  * start = shape
17143  * else:
17144  * if negative_step: # <<<<<<<<<<<<<<
17145  * start = shape - 1
17146  * else:
17147  */
17148  /*else*/ {
17149  __pyx_t_2 = (__pyx_v_negative_step != 0);
17150  if (__pyx_t_2) {
17151 
17152  /* "View.MemoryView":848
17153  * else:
17154  * if negative_step:
17155  * start = shape - 1 # <<<<<<<<<<<<<<
17156  * else:
17157  * start = 0
17158  */
17159  __pyx_v_start = (__pyx_v_shape - 1);
17160 
17161  /* "View.MemoryView":847
17162  * start = shape
17163  * else:
17164  * if negative_step: # <<<<<<<<<<<<<<
17165  * start = shape - 1
17166  * else:
17167  */
17168  goto __pyx_L15;
17169  }
17170 
17171  /* "View.MemoryView":850
17172  * start = shape - 1
17173  * else:
17174  * start = 0 # <<<<<<<<<<<<<<
17175  *
17176  * if have_stop:
17177  */
17178  /*else*/ {
17179  __pyx_v_start = 0;
17180  }
17181  __pyx_L15:;
17182  }
17183  __pyx_L11:;
17184 
17185  /* "View.MemoryView":852
17186  * start = 0
17187  *
17188  * if have_stop: # <<<<<<<<<<<<<<
17189  * if stop < 0:
17190  * stop += shape
17191  */
17192  __pyx_t_2 = (__pyx_v_have_stop != 0);
17193  if (__pyx_t_2) {
17194 
17195  /* "View.MemoryView":853
17196  *
17197  * if have_stop:
17198  * if stop < 0: # <<<<<<<<<<<<<<
17199  * stop += shape
17200  * if stop < 0:
17201  */
17202  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
17203  if (__pyx_t_2) {
17204 
17205  /* "View.MemoryView":854
17206  * if have_stop:
17207  * if stop < 0:
17208  * stop += shape # <<<<<<<<<<<<<<
17209  * if stop < 0:
17210  * stop = 0
17211  */
17212  __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
17213 
17214  /* "View.MemoryView":855
17215  * if stop < 0:
17216  * stop += shape
17217  * if stop < 0: # <<<<<<<<<<<<<<
17218  * stop = 0
17219  * elif stop > shape:
17220  */
17221  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
17222  if (__pyx_t_2) {
17223 
17224  /* "View.MemoryView":856
17225  * stop += shape
17226  * if stop < 0:
17227  * stop = 0 # <<<<<<<<<<<<<<
17228  * elif stop > shape:
17229  * stop = shape
17230  */
17231  __pyx_v_stop = 0;
17232 
17233  /* "View.MemoryView":855
17234  * if stop < 0:
17235  * stop += shape
17236  * if stop < 0: # <<<<<<<<<<<<<<
17237  * stop = 0
17238  * elif stop > shape:
17239  */
17240  }
17241 
17242  /* "View.MemoryView":853
17243  *
17244  * if have_stop:
17245  * if stop < 0: # <<<<<<<<<<<<<<
17246  * stop += shape
17247  * if stop < 0:
17248  */
17249  goto __pyx_L17;
17250  }
17251 
17252  /* "View.MemoryView":857
17253  * if stop < 0:
17254  * stop = 0
17255  * elif stop > shape: # <<<<<<<<<<<<<<
17256  * stop = shape
17257  * else:
17258  */
17259  __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
17260  if (__pyx_t_2) {
17261 
17262  /* "View.MemoryView":858
17263  * stop = 0
17264  * elif stop > shape:
17265  * stop = shape # <<<<<<<<<<<<<<
17266  * else:
17267  * if negative_step:
17268  */
17269  __pyx_v_stop = __pyx_v_shape;
17270 
17271  /* "View.MemoryView":857
17272  * if stop < 0:
17273  * stop = 0
17274  * elif stop > shape: # <<<<<<<<<<<<<<
17275  * stop = shape
17276  * else:
17277  */
17278  }
17279  __pyx_L17:;
17280 
17281  /* "View.MemoryView":852
17282  * start = 0
17283  *
17284  * if have_stop: # <<<<<<<<<<<<<<
17285  * if stop < 0:
17286  * stop += shape
17287  */
17288  goto __pyx_L16;
17289  }
17290 
17291  /* "View.MemoryView":860
17292  * stop = shape
17293  * else:
17294  * if negative_step: # <<<<<<<<<<<<<<
17295  * stop = -1
17296  * else:
17297  */
17298  /*else*/ {
17299  __pyx_t_2 = (__pyx_v_negative_step != 0);
17300  if (__pyx_t_2) {
17301 
17302  /* "View.MemoryView":861
17303  * else:
17304  * if negative_step:
17305  * stop = -1 # <<<<<<<<<<<<<<
17306  * else:
17307  * stop = shape
17308  */
17309  __pyx_v_stop = -1L;
17310 
17311  /* "View.MemoryView":860
17312  * stop = shape
17313  * else:
17314  * if negative_step: # <<<<<<<<<<<<<<
17315  * stop = -1
17316  * else:
17317  */
17318  goto __pyx_L19;
17319  }
17320 
17321  /* "View.MemoryView":863
17322  * stop = -1
17323  * else:
17324  * stop = shape # <<<<<<<<<<<<<<
17325  *
17326  * if not have_step:
17327  */
17328  /*else*/ {
17329  __pyx_v_stop = __pyx_v_shape;
17330  }
17331  __pyx_L19:;
17332  }
17333  __pyx_L16:;
17334 
17335  /* "View.MemoryView":865
17336  * stop = shape
17337  *
17338  * if not have_step: # <<<<<<<<<<<<<<
17339  * step = 1
17340  *
17341  */
17342  __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
17343  if (__pyx_t_2) {
17344 
17345  /* "View.MemoryView":866
17346  *
17347  * if not have_step:
17348  * step = 1 # <<<<<<<<<<<<<<
17349  *
17350  *
17351  */
17352  __pyx_v_step = 1;
17353 
17354  /* "View.MemoryView":865
17355  * stop = shape
17356  *
17357  * if not have_step: # <<<<<<<<<<<<<<
17358  * step = 1
17359  *
17360  */
17361  }
17362 
17363  /* "View.MemoryView":870
17364  *
17365  * with cython.cdivision(True):
17366  * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
17367  *
17368  * if (stop - start) - step * new_shape:
17369  */
17370  __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
17371 
17372  /* "View.MemoryView":872
17373  * new_shape = (stop - start) // step
17374  *
17375  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
17376  * new_shape += 1
17377  *
17378  */
17379  __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
17380  if (__pyx_t_2) {
17381 
17382  /* "View.MemoryView":873
17383  *
17384  * if (stop - start) - step * new_shape:
17385  * new_shape += 1 # <<<<<<<<<<<<<<
17386  *
17387  * if new_shape < 0:
17388  */
17389  __pyx_v_new_shape = (__pyx_v_new_shape + 1);
17390 
17391  /* "View.MemoryView":872
17392  * new_shape = (stop - start) // step
17393  *
17394  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
17395  * new_shape += 1
17396  *
17397  */
17398  }
17399 
17400  /* "View.MemoryView":875
17401  * new_shape += 1
17402  *
17403  * if new_shape < 0: # <<<<<<<<<<<<<<
17404  * new_shape = 0
17405  *
17406  */
17407  __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
17408  if (__pyx_t_2) {
17409 
17410  /* "View.MemoryView":876
17411  *
17412  * if new_shape < 0:
17413  * new_shape = 0 # <<<<<<<<<<<<<<
17414  *
17415  *
17416  */
17417  __pyx_v_new_shape = 0;
17418 
17419  /* "View.MemoryView":875
17420  * new_shape += 1
17421  *
17422  * if new_shape < 0: # <<<<<<<<<<<<<<
17423  * new_shape = 0
17424  *
17425  */
17426  }
17427 
17428  /* "View.MemoryView":879
17429  *
17430  *
17431  * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
17432  * dst.shape[new_ndim] = new_shape
17433  * dst.suboffsets[new_ndim] = suboffset
17434  */
17435  (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
17436 
17437  /* "View.MemoryView":880
17438  *
17439  * dst.strides[new_ndim] = stride * step
17440  * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
17441  * dst.suboffsets[new_ndim] = suboffset
17442  *
17443  */
17444  (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
17445 
17446  /* "View.MemoryView":881
17447  * dst.strides[new_ndim] = stride * step
17448  * dst.shape[new_ndim] = new_shape
17449  * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
17450  *
17451  *
17452  */
17453  (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
17454  }
17455  __pyx_L3:;
17456 
17457  /* "View.MemoryView":884
17458  *
17459  *
17460  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
17461  * dst.data += start * stride
17462  * else:
17463  */
17464  __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
17465  if (__pyx_t_2) {
17466 
17467  /* "View.MemoryView":885
17468  *
17469  * if suboffset_dim[0] < 0:
17470  * dst.data += start * stride # <<<<<<<<<<<<<<
17471  * else:
17472  * dst.suboffsets[suboffset_dim[0]] += start * stride
17473  */
17474  __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
17475 
17476  /* "View.MemoryView":884
17477  *
17478  *
17479  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
17480  * dst.data += start * stride
17481  * else:
17482  */
17483  goto __pyx_L23;
17484  }
17485 
17486  /* "View.MemoryView":887
17487  * dst.data += start * stride
17488  * else:
17489  * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
17490  *
17491  * if suboffset >= 0:
17492  */
17493  /*else*/ {
17494  __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
17495  (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
17496  }
17497  __pyx_L23:;
17498 
17499  /* "View.MemoryView":889
17500  * dst.suboffsets[suboffset_dim[0]] += start * stride
17501  *
17502  * if suboffset >= 0: # <<<<<<<<<<<<<<
17503  * if not is_slice:
17504  * if new_ndim == 0:
17505  */
17506  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
17507  if (__pyx_t_2) {
17508 
17509  /* "View.MemoryView":890
17510  *
17511  * if suboffset >= 0:
17512  * if not is_slice: # <<<<<<<<<<<<<<
17513  * if new_ndim == 0:
17514  * dst.data = (<char **> dst.data)[0] + suboffset
17515  */
17516  __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
17517  if (__pyx_t_2) {
17518 
17519  /* "View.MemoryView":891
17520  * if suboffset >= 0:
17521  * if not is_slice:
17522  * if new_ndim == 0: # <<<<<<<<<<<<<<
17523  * dst.data = (<char **> dst.data)[0] + suboffset
17524  * else:
17525  */
17526  __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
17527  if (__pyx_t_2) {
17528 
17529  /* "View.MemoryView":892
17530  * if not is_slice:
17531  * if new_ndim == 0:
17532  * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
17533  * else:
17534  * _err_dim(IndexError, "All dimensions preceding dimension %d "
17535  */
17536  __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
17537 
17538  /* "View.MemoryView":891
17539  * if suboffset >= 0:
17540  * if not is_slice:
17541  * if new_ndim == 0: # <<<<<<<<<<<<<<
17542  * dst.data = (<char **> dst.data)[0] + suboffset
17543  * else:
17544  */
17545  goto __pyx_L26;
17546  }
17547 
17548  /* "View.MemoryView":894
17549  * dst.data = (<char **> dst.data)[0] + suboffset
17550  * else:
17551  * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
17552  * "must be indexed and not sliced", dim)
17553  * else:
17554  */
17555  /*else*/ {
17556 
17557  /* "View.MemoryView":895
17558  * else:
17559  * _err_dim(IndexError, "All dimensions preceding dimension %d "
17560  * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
17561  * else:
17562  * suboffset_dim[0] = new_ndim
17563  */
17564  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 894, __pyx_L1_error)
17565  }
17566  __pyx_L26:;
17567 
17568  /* "View.MemoryView":890
17569  *
17570  * if suboffset >= 0:
17571  * if not is_slice: # <<<<<<<<<<<<<<
17572  * if new_ndim == 0:
17573  * dst.data = (<char **> dst.data)[0] + suboffset
17574  */
17575  goto __pyx_L25;
17576  }
17577 
17578  /* "View.MemoryView":897
17579  * "must be indexed and not sliced", dim)
17580  * else:
17581  * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
17582  *
17583  * return 0
17584  */
17585  /*else*/ {
17586  (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
17587  }
17588  __pyx_L25:;
17589 
17590  /* "View.MemoryView":889
17591  * dst.suboffsets[suboffset_dim[0]] += start * stride
17592  *
17593  * if suboffset >= 0: # <<<<<<<<<<<<<<
17594  * if not is_slice:
17595  * if new_ndim == 0:
17596  */
17597  }
17598 
17599  /* "View.MemoryView":899
17600  * suboffset_dim[0] = new_ndim
17601  *
17602  * return 0 # <<<<<<<<<<<<<<
17603  *
17604  *
17605  */
17606  __pyx_r = 0;
17607  goto __pyx_L0;
17608 
17609  /* "View.MemoryView":802
17610  *
17611  * @cname('__pyx_memoryview_slice_memviewslice')
17612  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
17613  * __Pyx_memviewslice *dst,
17614  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
17615  */
17616 
17617  /* function exit code */
17618  __pyx_L1_error:;
17619  {
17620  #ifdef WITH_THREAD
17621  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17622  #endif
17623  __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17624  #ifdef WITH_THREAD
17625  __Pyx_PyGILState_Release(__pyx_gilstate_save);
17626  #endif
17627  }
17628  __pyx_r = -1;
17629  __pyx_L0:;
17630  return __pyx_r;
17631 }
17632 
17633 /* "View.MemoryView":905
17634  *
17635  * @cname('__pyx_pybuffer_index')
17636  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
17637  * Py_ssize_t dim) except NULL:
17638  * cdef Py_ssize_t shape, stride, suboffset = -1
17639  */
17640 
17641 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
17642  Py_ssize_t __pyx_v_shape;
17643  Py_ssize_t __pyx_v_stride;
17644  Py_ssize_t __pyx_v_suboffset;
17645  Py_ssize_t __pyx_v_itemsize;
17646  char *__pyx_v_resultp;
17647  char *__pyx_r;
17648  __Pyx_RefNannyDeclarations
17649  Py_ssize_t __pyx_t_1;
17650  int __pyx_t_2;
17651  PyObject *__pyx_t_3 = NULL;
17652  PyObject *__pyx_t_4 = NULL;
17653  __Pyx_RefNannySetupContext("pybuffer_index", 0);
17654 
17655  /* "View.MemoryView":907
17656  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
17657  * Py_ssize_t dim) except NULL:
17658  * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
17659  * cdef Py_ssize_t itemsize = view.itemsize
17660  * cdef char *resultp
17661  */
17662  __pyx_v_suboffset = -1L;
17663 
17664  /* "View.MemoryView":908
17665  * Py_ssize_t dim) except NULL:
17666  * cdef Py_ssize_t shape, stride, suboffset = -1
17667  * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
17668  * cdef char *resultp
17669  *
17670  */
17671  __pyx_t_1 = __pyx_v_view->itemsize;
17672  __pyx_v_itemsize = __pyx_t_1;
17673 
17674  /* "View.MemoryView":911
17675  * cdef char *resultp
17676  *
17677  * if view.ndim == 0: # <<<<<<<<<<<<<<
17678  * shape = view.len / itemsize
17679  * stride = itemsize
17680  */
17681  __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
17682  if (__pyx_t_2) {
17683 
17684  /* "View.MemoryView":912
17685  *
17686  * if view.ndim == 0:
17687  * shape = view.len / itemsize # <<<<<<<<<<<<<<
17688  * stride = itemsize
17689  * else:
17690  */
17691  if (unlikely(__pyx_v_itemsize == 0)) {
17692  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
17693  __PYX_ERR(1, 912, __pyx_L1_error)
17694  }
17695  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
17696  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
17697  __PYX_ERR(1, 912, __pyx_L1_error)
17698  }
17699  __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
17700 
17701  /* "View.MemoryView":913
17702  * if view.ndim == 0:
17703  * shape = view.len / itemsize
17704  * stride = itemsize # <<<<<<<<<<<<<<
17705  * else:
17706  * shape = view.shape[dim]
17707  */
17708  __pyx_v_stride = __pyx_v_itemsize;
17709 
17710  /* "View.MemoryView":911
17711  * cdef char *resultp
17712  *
17713  * if view.ndim == 0: # <<<<<<<<<<<<<<
17714  * shape = view.len / itemsize
17715  * stride = itemsize
17716  */
17717  goto __pyx_L3;
17718  }
17719 
17720  /* "View.MemoryView":915
17721  * stride = itemsize
17722  * else:
17723  * shape = view.shape[dim] # <<<<<<<<<<<<<<
17724  * stride = view.strides[dim]
17725  * if view.suboffsets != NULL:
17726  */
17727  /*else*/ {
17728  __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
17729 
17730  /* "View.MemoryView":916
17731  * else:
17732  * shape = view.shape[dim]
17733  * stride = view.strides[dim] # <<<<<<<<<<<<<<
17734  * if view.suboffsets != NULL:
17735  * suboffset = view.suboffsets[dim]
17736  */
17737  __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
17738 
17739  /* "View.MemoryView":917
17740  * shape = view.shape[dim]
17741  * stride = view.strides[dim]
17742  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
17743  * suboffset = view.suboffsets[dim]
17744  *
17745  */
17746  __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
17747  if (__pyx_t_2) {
17748 
17749  /* "View.MemoryView":918
17750  * stride = view.strides[dim]
17751  * if view.suboffsets != NULL:
17752  * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
17753  *
17754  * if index < 0:
17755  */
17756  __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
17757 
17758  /* "View.MemoryView":917
17759  * shape = view.shape[dim]
17760  * stride = view.strides[dim]
17761  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
17762  * suboffset = view.suboffsets[dim]
17763  *
17764  */
17765  }
17766  }
17767  __pyx_L3:;
17768 
17769  /* "View.MemoryView":920
17770  * suboffset = view.suboffsets[dim]
17771  *
17772  * if index < 0: # <<<<<<<<<<<<<<
17773  * index += view.shape[dim]
17774  * if index < 0:
17775  */
17776  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
17777  if (__pyx_t_2) {
17778 
17779  /* "View.MemoryView":921
17780  *
17781  * if index < 0:
17782  * index += view.shape[dim] # <<<<<<<<<<<<<<
17783  * if index < 0:
17784  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17785  */
17786  __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
17787 
17788  /* "View.MemoryView":922
17789  * if index < 0:
17790  * index += view.shape[dim]
17791  * if index < 0: # <<<<<<<<<<<<<<
17792  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17793  *
17794  */
17795  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
17796  if (unlikely(__pyx_t_2)) {
17797 
17798  /* "View.MemoryView":923
17799  * index += view.shape[dim]
17800  * if index < 0:
17801  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
17802  *
17803  * if index >= shape:
17804  */
17805  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 923, __pyx_L1_error)
17806  __Pyx_GOTREF(__pyx_t_3);
17807  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 923, __pyx_L1_error)
17808  __Pyx_GOTREF(__pyx_t_4);
17809  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17810  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 923, __pyx_L1_error)
17811  __Pyx_GOTREF(__pyx_t_3);
17812  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17813  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
17814  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17815  __PYX_ERR(1, 923, __pyx_L1_error)
17816 
17817  /* "View.MemoryView":922
17818  * if index < 0:
17819  * index += view.shape[dim]
17820  * if index < 0: # <<<<<<<<<<<<<<
17821  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17822  *
17823  */
17824  }
17825 
17826  /* "View.MemoryView":920
17827  * suboffset = view.suboffsets[dim]
17828  *
17829  * if index < 0: # <<<<<<<<<<<<<<
17830  * index += view.shape[dim]
17831  * if index < 0:
17832  */
17833  }
17834 
17835  /* "View.MemoryView":925
17836  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17837  *
17838  * if index >= shape: # <<<<<<<<<<<<<<
17839  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17840  *
17841  */
17842  __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
17843  if (unlikely(__pyx_t_2)) {
17844 
17845  /* "View.MemoryView":926
17846  *
17847  * if index >= shape:
17848  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
17849  *
17850  * resultp = bufp + index * stride
17851  */
17852  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 926, __pyx_L1_error)
17853  __Pyx_GOTREF(__pyx_t_3);
17854  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 926, __pyx_L1_error)
17855  __Pyx_GOTREF(__pyx_t_4);
17856  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17857  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 926, __pyx_L1_error)
17858  __Pyx_GOTREF(__pyx_t_3);
17859  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17860  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
17861  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17862  __PYX_ERR(1, 926, __pyx_L1_error)
17863 
17864  /* "View.MemoryView":925
17865  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17866  *
17867  * if index >= shape: # <<<<<<<<<<<<<<
17868  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17869  *
17870  */
17871  }
17872 
17873  /* "View.MemoryView":928
17874  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17875  *
17876  * resultp = bufp + index * stride # <<<<<<<<<<<<<<
17877  * if suboffset >= 0:
17878  * resultp = (<char **> resultp)[0] + suboffset
17879  */
17880  __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
17881 
17882  /* "View.MemoryView":929
17883  *
17884  * resultp = bufp + index * stride
17885  * if suboffset >= 0: # <<<<<<<<<<<<<<
17886  * resultp = (<char **> resultp)[0] + suboffset
17887  *
17888  */
17889  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
17890  if (__pyx_t_2) {
17891 
17892  /* "View.MemoryView":930
17893  * resultp = bufp + index * stride
17894  * if suboffset >= 0:
17895  * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
17896  *
17897  * return resultp
17898  */
17899  __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
17900 
17901  /* "View.MemoryView":929
17902  *
17903  * resultp = bufp + index * stride
17904  * if suboffset >= 0: # <<<<<<<<<<<<<<
17905  * resultp = (<char **> resultp)[0] + suboffset
17906  *
17907  */
17908  }
17909 
17910  /* "View.MemoryView":932
17911  * resultp = (<char **> resultp)[0] + suboffset
17912  *
17913  * return resultp # <<<<<<<<<<<<<<
17914  *
17915  *
17916  */
17917  __pyx_r = __pyx_v_resultp;
17918  goto __pyx_L0;
17919 
17920  /* "View.MemoryView":905
17921  *
17922  * @cname('__pyx_pybuffer_index')
17923  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
17924  * Py_ssize_t dim) except NULL:
17925  * cdef Py_ssize_t shape, stride, suboffset = -1
17926  */
17927 
17928  /* function exit code */
17929  __pyx_L1_error:;
17930  __Pyx_XDECREF(__pyx_t_3);
17931  __Pyx_XDECREF(__pyx_t_4);
17932  __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
17933  __pyx_r = NULL;
17934  __pyx_L0:;
17935  __Pyx_RefNannyFinishContext();
17936  return __pyx_r;
17937 }
17938 
17939 /* "View.MemoryView":938
17940  *
17941  * @cname('__pyx_memslice_transpose')
17942  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
17943  * cdef int ndim = memslice.memview.view.ndim
17944  *
17945  */
17946 
17947 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
17948  int __pyx_v_ndim;
17949  Py_ssize_t *__pyx_v_shape;
17950  Py_ssize_t *__pyx_v_strides;
17951  int __pyx_v_i;
17952  int __pyx_v_j;
17953  int __pyx_r;
17954  int __pyx_t_1;
17955  Py_ssize_t *__pyx_t_2;
17956  long __pyx_t_3;
17957  long __pyx_t_4;
17958  Py_ssize_t __pyx_t_5;
17959  Py_ssize_t __pyx_t_6;
17960  int __pyx_t_7;
17961  int __pyx_t_8;
17962  int __pyx_t_9;
17963 
17964  /* "View.MemoryView":939
17965  * @cname('__pyx_memslice_transpose')
17966  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
17967  * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
17968  *
17969  * cdef Py_ssize_t *shape = memslice.shape
17970  */
17971  __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
17972  __pyx_v_ndim = __pyx_t_1;
17973 
17974  /* "View.MemoryView":941
17975  * cdef int ndim = memslice.memview.view.ndim
17976  *
17977  * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
17978  * cdef Py_ssize_t *strides = memslice.strides
17979  *
17980  */
17981  __pyx_t_2 = __pyx_v_memslice->shape;
17982  __pyx_v_shape = __pyx_t_2;
17983 
17984  /* "View.MemoryView":942
17985  *
17986  * cdef Py_ssize_t *shape = memslice.shape
17987  * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
17988  *
17989  *
17990  */
17991  __pyx_t_2 = __pyx_v_memslice->strides;
17992  __pyx_v_strides = __pyx_t_2;
17993 
17994  /* "View.MemoryView":946
17995  *
17996  * cdef int i, j
17997  * for i in range(ndim / 2): # <<<<<<<<<<<<<<
17998  * j = ndim - 1 - i
17999  * strides[i], strides[j] = strides[j], strides[i]
18000  */
18001  __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
18002  __pyx_t_4 = __pyx_t_3;
18003  for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
18004  __pyx_v_i = __pyx_t_1;
18005 
18006  /* "View.MemoryView":947
18007  * cdef int i, j
18008  * for i in range(ndim / 2):
18009  * j = ndim - 1 - i # <<<<<<<<<<<<<<
18010  * strides[i], strides[j] = strides[j], strides[i]
18011  * shape[i], shape[j] = shape[j], shape[i]
18012  */
18013  __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
18014 
18015  /* "View.MemoryView":948
18016  * for i in range(ndim / 2):
18017  * j = ndim - 1 - i
18018  * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
18019  * shape[i], shape[j] = shape[j], shape[i]
18020  *
18021  */
18022  __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
18023  __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
18024  (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
18025  (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
18026 
18027  /* "View.MemoryView":949
18028  * j = ndim - 1 - i
18029  * strides[i], strides[j] = strides[j], strides[i]
18030  * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
18031  *
18032  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
18033  */
18034  __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
18035  __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
18036  (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
18037  (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
18038 
18039  /* "View.MemoryView":951
18040  * shape[i], shape[j] = shape[j], shape[i]
18041  *
18042  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
18043  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
18044  *
18045  */
18046  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
18047  if (!__pyx_t_8) {
18048  } else {
18049  __pyx_t_7 = __pyx_t_8;
18050  goto __pyx_L6_bool_binop_done;
18051  }
18052  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
18053  __pyx_t_7 = __pyx_t_8;
18054  __pyx_L6_bool_binop_done:;
18055  if (__pyx_t_7) {
18056 
18057  /* "View.MemoryView":952
18058  *
18059  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
18060  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
18061  *
18062  * return 1
18063  */
18064  __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 952, __pyx_L1_error)
18065 
18066  /* "View.MemoryView":951
18067  * shape[i], shape[j] = shape[j], shape[i]
18068  *
18069  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
18070  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
18071  *
18072  */
18073  }
18074  }
18075 
18076  /* "View.MemoryView":954
18077  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
18078  *
18079  * return 1 # <<<<<<<<<<<<<<
18080  *
18081  *
18082  */
18083  __pyx_r = 1;
18084  goto __pyx_L0;
18085 
18086  /* "View.MemoryView":938
18087  *
18088  * @cname('__pyx_memslice_transpose')
18089  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
18090  * cdef int ndim = memslice.memview.view.ndim
18091  *
18092  */
18093 
18094  /* function exit code */
18095  __pyx_L1_error:;
18096  {
18097  #ifdef WITH_THREAD
18098  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18099  #endif
18100  __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18101  #ifdef WITH_THREAD
18102  __Pyx_PyGILState_Release(__pyx_gilstate_save);
18103  #endif
18104  }
18105  __pyx_r = 0;
18106  __pyx_L0:;
18107  return __pyx_r;
18108 }
18109 
18110 /* "View.MemoryView":971
18111  * cdef int (*to_dtype_func)(char *, object) except 0
18112  *
18113  * def __dealloc__(self): # <<<<<<<<<<<<<<
18114  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
18115  *
18116  */
18117 
18118 /* Python wrapper */
18119 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
18120 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
18121  __Pyx_RefNannyDeclarations
18122  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
18123  __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
18124 
18125  /* function exit code */
18126  __Pyx_RefNannyFinishContext();
18127 }
18128 
18129 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
18130  __Pyx_RefNannyDeclarations
18131  __Pyx_RefNannySetupContext("__dealloc__", 0);
18132 
18133  /* "View.MemoryView":972
18134  *
18135  * def __dealloc__(self):
18136  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
18137  *
18138  * cdef convert_item_to_object(self, char *itemp):
18139  */
18140  __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
18141 
18142  /* "View.MemoryView":971
18143  * cdef int (*to_dtype_func)(char *, object) except 0
18144  *
18145  * def __dealloc__(self): # <<<<<<<<<<<<<<
18146  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
18147  *
18148  */
18149 
18150  /* function exit code */
18151  __Pyx_RefNannyFinishContext();
18152 }
18153 
18154 /* "View.MemoryView":974
18155  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
18156  *
18157  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
18158  * if self.to_object_func != NULL:
18159  * return self.to_object_func(itemp)
18160  */
18161 
18162 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
18163  PyObject *__pyx_r = NULL;
18164  __Pyx_RefNannyDeclarations
18165  int __pyx_t_1;
18166  PyObject *__pyx_t_2 = NULL;
18167  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
18168 
18169  /* "View.MemoryView":975
18170  *
18171  * cdef convert_item_to_object(self, char *itemp):
18172  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
18173  * return self.to_object_func(itemp)
18174  * else:
18175  */
18176  __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
18177  if (__pyx_t_1) {
18178 
18179  /* "View.MemoryView":976
18180  * cdef convert_item_to_object(self, char *itemp):
18181  * if self.to_object_func != NULL:
18182  * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
18183  * else:
18184  * return memoryview.convert_item_to_object(self, itemp)
18185  */
18186  __Pyx_XDECREF(__pyx_r);
18187  __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 976, __pyx_L1_error)
18188  __Pyx_GOTREF(__pyx_t_2);
18189  __pyx_r = __pyx_t_2;
18190  __pyx_t_2 = 0;
18191  goto __pyx_L0;
18192 
18193  /* "View.MemoryView":975
18194  *
18195  * cdef convert_item_to_object(self, char *itemp):
18196  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
18197  * return self.to_object_func(itemp)
18198  * else:
18199  */
18200  }
18201 
18202  /* "View.MemoryView":978
18203  * return self.to_object_func(itemp)
18204  * else:
18205  * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
18206  *
18207  * cdef assign_item_from_object(self, char *itemp, object value):
18208  */
18209  /*else*/ {
18210  __Pyx_XDECREF(__pyx_r);
18211  __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 978, __pyx_L1_error)
18212  __Pyx_GOTREF(__pyx_t_2);
18213  __pyx_r = __pyx_t_2;
18214  __pyx_t_2 = 0;
18215  goto __pyx_L0;
18216  }
18217 
18218  /* "View.MemoryView":974
18219  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
18220  *
18221  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
18222  * if self.to_object_func != NULL:
18223  * return self.to_object_func(itemp)
18224  */
18225 
18226  /* function exit code */
18227  __pyx_L1_error:;
18228  __Pyx_XDECREF(__pyx_t_2);
18229  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
18230  __pyx_r = 0;
18231  __pyx_L0:;
18232  __Pyx_XGIVEREF(__pyx_r);
18233  __Pyx_RefNannyFinishContext();
18234  return __pyx_r;
18235 }
18236 
18237 /* "View.MemoryView":980
18238  * return memoryview.convert_item_to_object(self, itemp)
18239  *
18240  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
18241  * if self.to_dtype_func != NULL:
18242  * self.to_dtype_func(itemp, value)
18243  */
18244 
18245 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
18246  PyObject *__pyx_r = NULL;
18247  __Pyx_RefNannyDeclarations
18248  int __pyx_t_1;
18249  int __pyx_t_2;
18250  PyObject *__pyx_t_3 = NULL;
18251  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
18252 
18253  /* "View.MemoryView":981
18254  *
18255  * cdef assign_item_from_object(self, char *itemp, object value):
18256  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
18257  * self.to_dtype_func(itemp, value)
18258  * else:
18259  */
18260  __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
18261  if (__pyx_t_1) {
18262 
18263  /* "View.MemoryView":982
18264  * cdef assign_item_from_object(self, char *itemp, object value):
18265  * if self.to_dtype_func != NULL:
18266  * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
18267  * else:
18268  * memoryview.assign_item_from_object(self, itemp, value)
18269  */
18270  __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 982, __pyx_L1_error)
18271 
18272  /* "View.MemoryView":981
18273  *
18274  * cdef assign_item_from_object(self, char *itemp, object value):
18275  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
18276  * self.to_dtype_func(itemp, value)
18277  * else:
18278  */
18279  goto __pyx_L3;
18280  }
18281 
18282  /* "View.MemoryView":984
18283  * self.to_dtype_func(itemp, value)
18284  * else:
18285  * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
18286  *
18287  * @property
18288  */
18289  /*else*/ {
18290  __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 984, __pyx_L1_error)
18291  __Pyx_GOTREF(__pyx_t_3);
18292  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18293  }
18294  __pyx_L3:;
18295 
18296  /* "View.MemoryView":980
18297  * return memoryview.convert_item_to_object(self, itemp)
18298  *
18299  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
18300  * if self.to_dtype_func != NULL:
18301  * self.to_dtype_func(itemp, value)
18302  */
18303 
18304  /* function exit code */
18305  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18306  goto __pyx_L0;
18307  __pyx_L1_error:;
18308  __Pyx_XDECREF(__pyx_t_3);
18309  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
18310  __pyx_r = 0;
18311  __pyx_L0:;
18312  __Pyx_XGIVEREF(__pyx_r);
18313  __Pyx_RefNannyFinishContext();
18314  return __pyx_r;
18315 }
18316 
18317 /* "View.MemoryView":987
18318  *
18319  * @property
18320  * def base(self): # <<<<<<<<<<<<<<
18321  * return self.from_object
18322  *
18323  */
18324 
18325 /* Python wrapper */
18326 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
18327 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
18328  PyObject *__pyx_r = 0;
18329  __Pyx_RefNannyDeclarations
18330  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
18331  __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
18332 
18333  /* function exit code */
18334  __Pyx_RefNannyFinishContext();
18335  return __pyx_r;
18336 }
18337 
18338 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
18339  PyObject *__pyx_r = NULL;
18340  __Pyx_RefNannyDeclarations
18341  __Pyx_RefNannySetupContext("__get__", 0);
18342 
18343  /* "View.MemoryView":988
18344  * @property
18345  * def base(self):
18346  * return self.from_object # <<<<<<<<<<<<<<
18347  *
18348  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
18349  */
18350  __Pyx_XDECREF(__pyx_r);
18351  __Pyx_INCREF(__pyx_v_self->from_object);
18352  __pyx_r = __pyx_v_self->from_object;
18353  goto __pyx_L0;
18354 
18355  /* "View.MemoryView":987
18356  *
18357  * @property
18358  * def base(self): # <<<<<<<<<<<<<<
18359  * return self.from_object
18360  *
18361  */
18362 
18363  /* function exit code */
18364  __pyx_L0:;
18365  __Pyx_XGIVEREF(__pyx_r);
18366  __Pyx_RefNannyFinishContext();
18367  return __pyx_r;
18368 }
18369 
18370 /* "(tree fragment)":1
18371  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
18372  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18373  * def __setstate_cython__(self, __pyx_state):
18374  */
18375 
18376 /* Python wrapper */
18377 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
18378 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
18379  PyObject *__pyx_r = 0;
18380  __Pyx_RefNannyDeclarations
18381  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
18382  __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
18383 
18384  /* function exit code */
18385  __Pyx_RefNannyFinishContext();
18386  return __pyx_r;
18387 }
18388 
18389 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
18390  PyObject *__pyx_r = NULL;
18391  __Pyx_RefNannyDeclarations
18392  PyObject *__pyx_t_1 = NULL;
18393  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
18394 
18395  /* "(tree fragment)":2
18396  * def __reduce_cython__(self):
18397  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
18398  * def __setstate_cython__(self, __pyx_state):
18399  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18400  */
18401  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
18402  __Pyx_GOTREF(__pyx_t_1);
18403  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
18404  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18405  __PYX_ERR(1, 2, __pyx_L1_error)
18406 
18407  /* "(tree fragment)":1
18408  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
18409  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18410  * def __setstate_cython__(self, __pyx_state):
18411  */
18412 
18413  /* function exit code */
18414  __pyx_L1_error:;
18415  __Pyx_XDECREF(__pyx_t_1);
18416  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18417  __pyx_r = NULL;
18418  __Pyx_XGIVEREF(__pyx_r);
18419  __Pyx_RefNannyFinishContext();
18420  return __pyx_r;
18421 }
18422 
18423 /* "(tree fragment)":3
18424  * def __reduce_cython__(self):
18425  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18426  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
18427  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18428  */
18429 
18430 /* Python wrapper */
18431 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
18432 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
18433  PyObject *__pyx_r = 0;
18434  __Pyx_RefNannyDeclarations
18435  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
18436  __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
18437 
18438  /* function exit code */
18439  __Pyx_RefNannyFinishContext();
18440  return __pyx_r;
18441 }
18442 
18443 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
18444  PyObject *__pyx_r = NULL;
18445  __Pyx_RefNannyDeclarations
18446  PyObject *__pyx_t_1 = NULL;
18447  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
18448 
18449  /* "(tree fragment)":4
18450  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18451  * def __setstate_cython__(self, __pyx_state):
18452  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
18453  */
18454  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
18455  __Pyx_GOTREF(__pyx_t_1);
18456  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
18457  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18458  __PYX_ERR(1, 4, __pyx_L1_error)
18459 
18460  /* "(tree fragment)":3
18461  * def __reduce_cython__(self):
18462  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18463  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
18464  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18465  */
18466 
18467  /* function exit code */
18468  __pyx_L1_error:;
18469  __Pyx_XDECREF(__pyx_t_1);
18470  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18471  __pyx_r = NULL;
18472  __Pyx_XGIVEREF(__pyx_r);
18473  __Pyx_RefNannyFinishContext();
18474  return __pyx_r;
18475 }
18476 
18477 /* "View.MemoryView":994
18478  *
18479  * @cname('__pyx_memoryview_fromslice')
18480  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
18481  * int ndim,
18482  * object (*to_object_func)(char *),
18483  */
18484 
18485 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
18486  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
18487  Py_ssize_t __pyx_v_suboffset;
18488  PyObject *__pyx_v_length = NULL;
18489  PyObject *__pyx_r = NULL;
18490  __Pyx_RefNannyDeclarations
18491  int __pyx_t_1;
18492  PyObject *__pyx_t_2 = NULL;
18493  PyObject *__pyx_t_3 = NULL;
18494  __Pyx_TypeInfo *__pyx_t_4;
18495  Py_buffer __pyx_t_5;
18496  Py_ssize_t *__pyx_t_6;
18497  Py_ssize_t *__pyx_t_7;
18498  Py_ssize_t *__pyx_t_8;
18499  Py_ssize_t __pyx_t_9;
18500  __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
18501 
18502  /* "View.MemoryView":1002
18503  * cdef _memoryviewslice result
18504  *
18505  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
18506  * return None
18507  *
18508  */
18509  __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
18510  if (__pyx_t_1) {
18511 
18512  /* "View.MemoryView":1003
18513  *
18514  * if <PyObject *> memviewslice.memview == Py_None:
18515  * return None # <<<<<<<<<<<<<<
18516  *
18517  *
18518  */
18519  __Pyx_XDECREF(__pyx_r);
18520  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18521  goto __pyx_L0;
18522 
18523  /* "View.MemoryView":1002
18524  * cdef _memoryviewslice result
18525  *
18526  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
18527  * return None
18528  *
18529  */
18530  }
18531 
18532  /* "View.MemoryView":1008
18533  *
18534  *
18535  * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<<
18536  *
18537  * result.from_slice = memviewslice
18538  */
18539  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1008, __pyx_L1_error)
18540  __Pyx_GOTREF(__pyx_t_2);
18541  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1008, __pyx_L1_error)
18542  __Pyx_GOTREF(__pyx_t_3);
18543  __Pyx_INCREF(Py_None);
18544  __Pyx_GIVEREF(Py_None);
18545  PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
18546  __Pyx_INCREF(__pyx_int_0);
18547  __Pyx_GIVEREF(__pyx_int_0);
18548  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
18549  __Pyx_GIVEREF(__pyx_t_2);
18550  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
18551  __pyx_t_2 = 0;
18552  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1008, __pyx_L1_error)
18553  __Pyx_GOTREF(__pyx_t_2);
18554  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18555  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
18556  __pyx_t_2 = 0;
18557 
18558  /* "View.MemoryView":1010
18559  * result = _memoryviewslice(None, 0, dtype_is_object)
18560  *
18561  * result.from_slice = memviewslice # <<<<<<<<<<<<<<
18562  * __PYX_INC_MEMVIEW(&memviewslice, 1)
18563  *
18564  */
18565  __pyx_v_result->from_slice = __pyx_v_memviewslice;
18566 
18567  /* "View.MemoryView":1011
18568  *
18569  * result.from_slice = memviewslice
18570  * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
18571  *
18572  * result.from_object = (<memoryview> memviewslice.memview).base
18573  */
18574  __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
18575 
18576  /* "View.MemoryView":1013
18577  * __PYX_INC_MEMVIEW(&memviewslice, 1)
18578  *
18579  * result.from_object = (<memoryview> memviewslice.memview).base # <<<<<<<<<<<<<<
18580  * result.typeinfo = memviewslice.memview.typeinfo
18581  *
18582  */
18583  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
18584  __Pyx_GOTREF(__pyx_t_2);
18585  __Pyx_GIVEREF(__pyx_t_2);
18586  __Pyx_GOTREF(__pyx_v_result->from_object);
18587  __Pyx_DECREF(__pyx_v_result->from_object);
18588  __pyx_v_result->from_object = __pyx_t_2;
18589  __pyx_t_2 = 0;
18590 
18591  /* "View.MemoryView":1014
18592  *
18593  * result.from_object = (<memoryview> memviewslice.memview).base
18594  * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
18595  *
18596  * result.view = memviewslice.memview.view
18597  */
18598  __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
18599  __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
18600 
18601  /* "View.MemoryView":1016
18602  * result.typeinfo = memviewslice.memview.typeinfo
18603  *
18604  * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
18605  * result.view.buf = <void *> memviewslice.data
18606  * result.view.ndim = ndim
18607  */
18608  __pyx_t_5 = __pyx_v_memviewslice.memview->view;
18609  __pyx_v_result->__pyx_base.view = __pyx_t_5;
18610 
18611  /* "View.MemoryView":1017
18612  *
18613  * result.view = memviewslice.memview.view
18614  * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
18615  * result.view.ndim = ndim
18616  * (<__pyx_buffer *> &result.view).obj = Py_None
18617  */
18618  __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
18619 
18620  /* "View.MemoryView":1018
18621  * result.view = memviewslice.memview.view
18622  * result.view.buf = <void *> memviewslice.data
18623  * result.view.ndim = ndim # <<<<<<<<<<<<<<
18624  * (<__pyx_buffer *> &result.view).obj = Py_None
18625  * Py_INCREF(Py_None)
18626  */
18627  __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
18628 
18629  /* "View.MemoryView":1019
18630  * result.view.buf = <void *> memviewslice.data
18631  * result.view.ndim = ndim
18632  * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
18633  * Py_INCREF(Py_None)
18634  *
18635  */
18636  ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
18637 
18638  /* "View.MemoryView":1020
18639  * result.view.ndim = ndim
18640  * (<__pyx_buffer *> &result.view).obj = Py_None
18641  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
18642  *
18643  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
18644  */
18645  Py_INCREF(Py_None);
18646 
18647  /* "View.MemoryView":1022
18648  * Py_INCREF(Py_None)
18649  *
18650  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
18651  * result.flags = PyBUF_RECORDS
18652  * else:
18653  */
18654  __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
18655  if (__pyx_t_1) {
18656 
18657  /* "View.MemoryView":1023
18658  *
18659  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
18660  * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
18661  * else:
18662  * result.flags = PyBUF_RECORDS_RO
18663  */
18664  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
18665 
18666  /* "View.MemoryView":1022
18667  * Py_INCREF(Py_None)
18668  *
18669  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
18670  * result.flags = PyBUF_RECORDS
18671  * else:
18672  */
18673  goto __pyx_L4;
18674  }
18675 
18676  /* "View.MemoryView":1025
18677  * result.flags = PyBUF_RECORDS
18678  * else:
18679  * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
18680  *
18681  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
18682  */
18683  /*else*/ {
18684  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
18685  }
18686  __pyx_L4:;
18687 
18688  /* "View.MemoryView":1027
18689  * result.flags = PyBUF_RECORDS_RO
18690  *
18691  * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
18692  * result.view.strides = <Py_ssize_t *> result.from_slice.strides
18693  *
18694  */
18695  __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
18696 
18697  /* "View.MemoryView":1028
18698  *
18699  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
18700  * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
18701  *
18702  *
18703  */
18704  __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
18705 
18706  /* "View.MemoryView":1031
18707  *
18708  *
18709  * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
18710  * for suboffset in result.from_slice.suboffsets[:ndim]:
18711  * if suboffset >= 0:
18712  */
18713  __pyx_v_result->__pyx_base.view.suboffsets = NULL;
18714 
18715  /* "View.MemoryView":1032
18716  *
18717  * result.view.suboffsets = NULL
18718  * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
18719  * if suboffset >= 0:
18720  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
18721  */
18722  __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
18723  for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
18724  __pyx_t_6 = __pyx_t_8;
18725  __pyx_v_suboffset = (__pyx_t_6[0]);
18726 
18727  /* "View.MemoryView":1033
18728  * result.view.suboffsets = NULL
18729  * for suboffset in result.from_slice.suboffsets[:ndim]:
18730  * if suboffset >= 0: # <<<<<<<<<<<<<<
18731  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
18732  * break
18733  */
18734  __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
18735  if (__pyx_t_1) {
18736 
18737  /* "View.MemoryView":1034
18738  * for suboffset in result.from_slice.suboffsets[:ndim]:
18739  * if suboffset >= 0:
18740  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
18741  * break
18742  *
18743  */
18744  __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
18745 
18746  /* "View.MemoryView":1035
18747  * if suboffset >= 0:
18748  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
18749  * break # <<<<<<<<<<<<<<
18750  *
18751  * result.view.len = result.view.itemsize
18752  */
18753  goto __pyx_L6_break;
18754 
18755  /* "View.MemoryView":1033
18756  * result.view.suboffsets = NULL
18757  * for suboffset in result.from_slice.suboffsets[:ndim]:
18758  * if suboffset >= 0: # <<<<<<<<<<<<<<
18759  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
18760  * break
18761  */
18762  }
18763  }
18764  __pyx_L6_break:;
18765 
18766  /* "View.MemoryView":1037
18767  * break
18768  *
18769  * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
18770  * for length in result.view.shape[:ndim]:
18771  * result.view.len *= length
18772  */
18773  __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
18774  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
18775 
18776  /* "View.MemoryView":1038
18777  *
18778  * result.view.len = result.view.itemsize
18779  * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
18780  * result.view.len *= length
18781  *
18782  */
18783  __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
18784  for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
18785  __pyx_t_6 = __pyx_t_8;
18786  __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1038, __pyx_L1_error)
18787  __Pyx_GOTREF(__pyx_t_2);
18788  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
18789  __pyx_t_2 = 0;
18790 
18791  /* "View.MemoryView":1039
18792  * result.view.len = result.view.itemsize
18793  * for length in result.view.shape[:ndim]:
18794  * result.view.len *= length # <<<<<<<<<<<<<<
18795  *
18796  * result.to_object_func = to_object_func
18797  */
18798  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1039, __pyx_L1_error)
18799  __Pyx_GOTREF(__pyx_t_2);
18800  __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1039, __pyx_L1_error)
18801  __Pyx_GOTREF(__pyx_t_3);
18802  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18803  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1039, __pyx_L1_error)
18804  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18805  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
18806  }
18807 
18808  /* "View.MemoryView":1041
18809  * result.view.len *= length
18810  *
18811  * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
18812  * result.to_dtype_func = to_dtype_func
18813  *
18814  */
18815  __pyx_v_result->to_object_func = __pyx_v_to_object_func;
18816 
18817  /* "View.MemoryView":1042
18818  *
18819  * result.to_object_func = to_object_func
18820  * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
18821  *
18822  * return result
18823  */
18824  __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
18825 
18826  /* "View.MemoryView":1044
18827  * result.to_dtype_func = to_dtype_func
18828  *
18829  * return result # <<<<<<<<<<<<<<
18830  *
18831  * @cname('__pyx_memoryview_get_slice_from_memoryview')
18832  */
18833  __Pyx_XDECREF(__pyx_r);
18834  __Pyx_INCREF(((PyObject *)__pyx_v_result));
18835  __pyx_r = ((PyObject *)__pyx_v_result);
18836  goto __pyx_L0;
18837 
18838  /* "View.MemoryView":994
18839  *
18840  * @cname('__pyx_memoryview_fromslice')
18841  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
18842  * int ndim,
18843  * object (*to_object_func)(char *),
18844  */
18845 
18846  /* function exit code */
18847  __pyx_L1_error:;
18848  __Pyx_XDECREF(__pyx_t_2);
18849  __Pyx_XDECREF(__pyx_t_3);
18850  __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18851  __pyx_r = 0;
18852  __pyx_L0:;
18853  __Pyx_XDECREF((PyObject *)__pyx_v_result);
18854  __Pyx_XDECREF(__pyx_v_length);
18855  __Pyx_XGIVEREF(__pyx_r);
18856  __Pyx_RefNannyFinishContext();
18857  return __pyx_r;
18858 }
18859 
18860 /* "View.MemoryView":1047
18861  *
18862  * @cname('__pyx_memoryview_get_slice_from_memoryview')
18863  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
18864  * __Pyx_memviewslice *mslice):
18865  * cdef _memoryviewslice obj
18866  */
18867 
18868 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
18869  struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
18870  __Pyx_memviewslice *__pyx_r;
18871  __Pyx_RefNannyDeclarations
18872  int __pyx_t_1;
18873  int __pyx_t_2;
18874  PyObject *__pyx_t_3 = NULL;
18875  __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
18876 
18877  /* "View.MemoryView":1050
18878  * __Pyx_memviewslice *mslice):
18879  * cdef _memoryviewslice obj
18880  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18881  * obj = memview
18882  * return &obj.from_slice
18883  */
18884  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
18885  __pyx_t_2 = (__pyx_t_1 != 0);
18886  if (__pyx_t_2) {
18887 
18888  /* "View.MemoryView":1051
18889  * cdef _memoryviewslice obj
18890  * if isinstance(memview, _memoryviewslice):
18891  * obj = memview # <<<<<<<<<<<<<<
18892  * return &obj.from_slice
18893  * else:
18894  */
18895  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1051, __pyx_L1_error)
18896  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
18897  __Pyx_INCREF(__pyx_t_3);
18898  __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
18899  __pyx_t_3 = 0;
18900 
18901  /* "View.MemoryView":1052
18902  * if isinstance(memview, _memoryviewslice):
18903  * obj = memview
18904  * return &obj.from_slice # <<<<<<<<<<<<<<
18905  * else:
18906  * slice_copy(memview, mslice)
18907  */
18908  __pyx_r = (&__pyx_v_obj->from_slice);
18909  goto __pyx_L0;
18910 
18911  /* "View.MemoryView":1050
18912  * __Pyx_memviewslice *mslice):
18913  * cdef _memoryviewslice obj
18914  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18915  * obj = memview
18916  * return &obj.from_slice
18917  */
18918  }
18919 
18920  /* "View.MemoryView":1054
18921  * return &obj.from_slice
18922  * else:
18923  * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
18924  * return mslice
18925  *
18926  */
18927  /*else*/ {
18928  __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
18929 
18930  /* "View.MemoryView":1055
18931  * else:
18932  * slice_copy(memview, mslice)
18933  * return mslice # <<<<<<<<<<<<<<
18934  *
18935  * @cname('__pyx_memoryview_slice_copy')
18936  */
18937  __pyx_r = __pyx_v_mslice;
18938  goto __pyx_L0;
18939  }
18940 
18941  /* "View.MemoryView":1047
18942  *
18943  * @cname('__pyx_memoryview_get_slice_from_memoryview')
18944  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
18945  * __Pyx_memviewslice *mslice):
18946  * cdef _memoryviewslice obj
18947  */
18948 
18949  /* function exit code */
18950  __pyx_L1_error:;
18951  __Pyx_XDECREF(__pyx_t_3);
18952  __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
18953  __pyx_r = 0;
18954  __pyx_L0:;
18955  __Pyx_XDECREF((PyObject *)__pyx_v_obj);
18956  __Pyx_RefNannyFinishContext();
18957  return __pyx_r;
18958 }
18959 
18960 /* "View.MemoryView":1058
18961  *
18962  * @cname('__pyx_memoryview_slice_copy')
18963  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
18964  * cdef int dim
18965  * cdef (Py_ssize_t*) shape, strides, suboffsets
18966  */
18967 
18968 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
18969  int __pyx_v_dim;
18970  Py_ssize_t *__pyx_v_shape;
18971  Py_ssize_t *__pyx_v_strides;
18972  Py_ssize_t *__pyx_v_suboffsets;
18973  __Pyx_RefNannyDeclarations
18974  Py_ssize_t *__pyx_t_1;
18975  int __pyx_t_2;
18976  int __pyx_t_3;
18977  int __pyx_t_4;
18978  Py_ssize_t __pyx_t_5;
18979  __Pyx_RefNannySetupContext("slice_copy", 0);
18980 
18981  /* "View.MemoryView":1062
18982  * cdef (Py_ssize_t*) shape, strides, suboffsets
18983  *
18984  * shape = memview.view.shape # <<<<<<<<<<<<<<
18985  * strides = memview.view.strides
18986  * suboffsets = memview.view.suboffsets
18987  */
18988  __pyx_t_1 = __pyx_v_memview->view.shape;
18989  __pyx_v_shape = __pyx_t_1;
18990 
18991  /* "View.MemoryView":1063
18992  *
18993  * shape = memview.view.shape
18994  * strides = memview.view.strides # <<<<<<<<<<<<<<
18995  * suboffsets = memview.view.suboffsets
18996  *
18997  */
18998  __pyx_t_1 = __pyx_v_memview->view.strides;
18999  __pyx_v_strides = __pyx_t_1;
19000 
19001  /* "View.MemoryView":1064
19002  * shape = memview.view.shape
19003  * strides = memview.view.strides
19004  * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
19005  *
19006  * dst.memview = <__pyx_memoryview *> memview
19007  */
19008  __pyx_t_1 = __pyx_v_memview->view.suboffsets;
19009  __pyx_v_suboffsets = __pyx_t_1;
19010 
19011  /* "View.MemoryView":1066
19012  * suboffsets = memview.view.suboffsets
19013  *
19014  * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
19015  * dst.data = <char *> memview.view.buf
19016  *
19017  */
19018  __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
19019 
19020  /* "View.MemoryView":1067
19021  *
19022  * dst.memview = <__pyx_memoryview *> memview
19023  * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
19024  *
19025  * for dim in range(memview.view.ndim):
19026  */
19027  __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
19028 
19029  /* "View.MemoryView":1069
19030  * dst.data = <char *> memview.view.buf
19031  *
19032  * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
19033  * dst.shape[dim] = shape[dim]
19034  * dst.strides[dim] = strides[dim]
19035  */
19036  __pyx_t_2 = __pyx_v_memview->view.ndim;
19037  __pyx_t_3 = __pyx_t_2;
19038  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19039  __pyx_v_dim = __pyx_t_4;
19040 
19041  /* "View.MemoryView":1070
19042  *
19043  * for dim in range(memview.view.ndim):
19044  * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
19045  * dst.strides[dim] = strides[dim]
19046  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
19047  */
19048  (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
19049 
19050  /* "View.MemoryView":1071
19051  * for dim in range(memview.view.ndim):
19052  * dst.shape[dim] = shape[dim]
19053  * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
19054  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
19055  *
19056  */
19057  (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
19058 
19059  /* "View.MemoryView":1072
19060  * dst.shape[dim] = shape[dim]
19061  * dst.strides[dim] = strides[dim]
19062  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
19063  *
19064  * @cname('__pyx_memoryview_copy_object')
19065  */
19066  if ((__pyx_v_suboffsets != 0)) {
19067  __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
19068  } else {
19069  __pyx_t_5 = -1L;
19070  }
19071  (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
19072  }
19073 
19074  /* "View.MemoryView":1058
19075  *
19076  * @cname('__pyx_memoryview_slice_copy')
19077  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
19078  * cdef int dim
19079  * cdef (Py_ssize_t*) shape, strides, suboffsets
19080  */
19081 
19082  /* function exit code */
19083  __Pyx_RefNannyFinishContext();
19084 }
19085 
19086 /* "View.MemoryView":1075
19087  *
19088  * @cname('__pyx_memoryview_copy_object')
19089  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
19090  * "Create a new memoryview object"
19091  * cdef __Pyx_memviewslice memviewslice
19092  */
19093 
19094 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
19095  __Pyx_memviewslice __pyx_v_memviewslice;
19096  PyObject *__pyx_r = NULL;
19097  __Pyx_RefNannyDeclarations
19098  PyObject *__pyx_t_1 = NULL;
19099  __Pyx_RefNannySetupContext("memoryview_copy", 0);
19100 
19101  /* "View.MemoryView":1078
19102  * "Create a new memoryview object"
19103  * cdef __Pyx_memviewslice memviewslice
19104  * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
19105  * return memoryview_copy_from_slice(memview, &memviewslice)
19106  *
19107  */
19108  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
19109 
19110  /* "View.MemoryView":1079
19111  * cdef __Pyx_memviewslice memviewslice
19112  * slice_copy(memview, &memviewslice)
19113  * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
19114  *
19115  * @cname('__pyx_memoryview_copy_object_from_slice')
19116  */
19117  __Pyx_XDECREF(__pyx_r);
19118  __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1079, __pyx_L1_error)
19119  __Pyx_GOTREF(__pyx_t_1);
19120  __pyx_r = __pyx_t_1;
19121  __pyx_t_1 = 0;
19122  goto __pyx_L0;
19123 
19124  /* "View.MemoryView":1075
19125  *
19126  * @cname('__pyx_memoryview_copy_object')
19127  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
19128  * "Create a new memoryview object"
19129  * cdef __Pyx_memviewslice memviewslice
19130  */
19131 
19132  /* function exit code */
19133  __pyx_L1_error:;
19134  __Pyx_XDECREF(__pyx_t_1);
19135  __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
19136  __pyx_r = 0;
19137  __pyx_L0:;
19138  __Pyx_XGIVEREF(__pyx_r);
19139  __Pyx_RefNannyFinishContext();
19140  return __pyx_r;
19141 }
19142 
19143 /* "View.MemoryView":1082
19144  *
19145  * @cname('__pyx_memoryview_copy_object_from_slice')
19146  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
19147  * """
19148  * Create a new memoryview object from a given memoryview object and slice.
19149  */
19150 
19151 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
19152  PyObject *(*__pyx_v_to_object_func)(char *);
19153  int (*__pyx_v_to_dtype_func)(char *, PyObject *);
19154  PyObject *__pyx_r = NULL;
19155  __Pyx_RefNannyDeclarations
19156  int __pyx_t_1;
19157  int __pyx_t_2;
19158  PyObject *(*__pyx_t_3)(char *);
19159  int (*__pyx_t_4)(char *, PyObject *);
19160  PyObject *__pyx_t_5 = NULL;
19161  __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
19162 
19163  /* "View.MemoryView":1089
19164  * cdef int (*to_dtype_func)(char *, object) except 0
19165  *
19166  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
19167  * to_object_func = (<_memoryviewslice> memview).to_object_func
19168  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
19169  */
19170  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
19171  __pyx_t_2 = (__pyx_t_1 != 0);
19172  if (__pyx_t_2) {
19173 
19174  /* "View.MemoryView":1090
19175  *
19176  * if isinstance(memview, _memoryviewslice):
19177  * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
19178  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
19179  * else:
19180  */
19181  __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
19182  __pyx_v_to_object_func = __pyx_t_3;
19183 
19184  /* "View.MemoryView":1091
19185  * if isinstance(memview, _memoryviewslice):
19186  * to_object_func = (<_memoryviewslice> memview).to_object_func
19187  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
19188  * else:
19189  * to_object_func = NULL
19190  */
19191  __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
19192  __pyx_v_to_dtype_func = __pyx_t_4;
19193 
19194  /* "View.MemoryView":1089
19195  * cdef int (*to_dtype_func)(char *, object) except 0
19196  *
19197  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
19198  * to_object_func = (<_memoryviewslice> memview).to_object_func
19199  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
19200  */
19201  goto __pyx_L3;
19202  }
19203 
19204  /* "View.MemoryView":1093
19205  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
19206  * else:
19207  * to_object_func = NULL # <<<<<<<<<<<<<<
19208  * to_dtype_func = NULL
19209  *
19210  */
19211  /*else*/ {
19212  __pyx_v_to_object_func = NULL;
19213 
19214  /* "View.MemoryView":1094
19215  * else:
19216  * to_object_func = NULL
19217  * to_dtype_func = NULL # <<<<<<<<<<<<<<
19218  *
19219  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
19220  */
19221  __pyx_v_to_dtype_func = NULL;
19222  }
19223  __pyx_L3:;
19224 
19225  /* "View.MemoryView":1096
19226  * to_dtype_func = NULL
19227  *
19228  * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
19229  * to_object_func, to_dtype_func,
19230  * memview.dtype_is_object)
19231  */
19232  __Pyx_XDECREF(__pyx_r);
19233 
19234  /* "View.MemoryView":1098
19235  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
19236  * to_object_func, to_dtype_func,
19237  * memview.dtype_is_object) # <<<<<<<<<<<<<<
19238  *
19239  *
19240  */
19241  __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1096, __pyx_L1_error)
19242  __Pyx_GOTREF(__pyx_t_5);
19243  __pyx_r = __pyx_t_5;
19244  __pyx_t_5 = 0;
19245  goto __pyx_L0;
19246 
19247  /* "View.MemoryView":1082
19248  *
19249  * @cname('__pyx_memoryview_copy_object_from_slice')
19250  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
19251  * """
19252  * Create a new memoryview object from a given memoryview object and slice.
19253  */
19254 
19255  /* function exit code */
19256  __pyx_L1_error:;
19257  __Pyx_XDECREF(__pyx_t_5);
19258  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
19259  __pyx_r = 0;
19260  __pyx_L0:;
19261  __Pyx_XGIVEREF(__pyx_r);
19262  __Pyx_RefNannyFinishContext();
19263  return __pyx_r;
19264 }
19265 
19266 /* "View.MemoryView":1104
19267  *
19268  *
19269  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
19270  * if arg < 0:
19271  * return -arg
19272  */
19273 
19274 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
19275  Py_ssize_t __pyx_r;
19276  int __pyx_t_1;
19277 
19278  /* "View.MemoryView":1105
19279  *
19280  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
19281  * if arg < 0: # <<<<<<<<<<<<<<
19282  * return -arg
19283  * else:
19284  */
19285  __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
19286  if (__pyx_t_1) {
19287 
19288  /* "View.MemoryView":1106
19289  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
19290  * if arg < 0:
19291  * return -arg # <<<<<<<<<<<<<<
19292  * else:
19293  * return arg
19294  */
19295  __pyx_r = (-__pyx_v_arg);
19296  goto __pyx_L0;
19297 
19298  /* "View.MemoryView":1105
19299  *
19300  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
19301  * if arg < 0: # <<<<<<<<<<<<<<
19302  * return -arg
19303  * else:
19304  */
19305  }
19306 
19307  /* "View.MemoryView":1108
19308  * return -arg
19309  * else:
19310  * return arg # <<<<<<<<<<<<<<
19311  *
19312  * @cname('__pyx_get_best_slice_order')
19313  */
19314  /*else*/ {
19315  __pyx_r = __pyx_v_arg;
19316  goto __pyx_L0;
19317  }
19318 
19319  /* "View.MemoryView":1104
19320  *
19321  *
19322  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
19323  * if arg < 0:
19324  * return -arg
19325  */
19326 
19327  /* function exit code */
19328  __pyx_L0:;
19329  return __pyx_r;
19330 }
19331 
19332 /* "View.MemoryView":1111
19333  *
19334  * @cname('__pyx_get_best_slice_order')
19335  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
19336  * """
19337  * Figure out the best memory access order for a given slice.
19338  */
19339 
19340 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
19341  int __pyx_v_i;
19342  Py_ssize_t __pyx_v_c_stride;
19343  Py_ssize_t __pyx_v_f_stride;
19344  char __pyx_r;
19345  int __pyx_t_1;
19346  int __pyx_t_2;
19347  int __pyx_t_3;
19348  int __pyx_t_4;
19349 
19350  /* "View.MemoryView":1116
19351  * """
19352  * cdef int i
19353  * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
19354  * cdef Py_ssize_t f_stride = 0
19355  *
19356  */
19357  __pyx_v_c_stride = 0;
19358 
19359  /* "View.MemoryView":1117
19360  * cdef int i
19361  * cdef Py_ssize_t c_stride = 0
19362  * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
19363  *
19364  * for i in range(ndim - 1, -1, -1):
19365  */
19366  __pyx_v_f_stride = 0;
19367 
19368  /* "View.MemoryView":1119
19369  * cdef Py_ssize_t f_stride = 0
19370  *
19371  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
19372  * if mslice.shape[i] > 1:
19373  * c_stride = mslice.strides[i]
19374  */
19375  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
19376  __pyx_v_i = __pyx_t_1;
19377 
19378  /* "View.MemoryView":1120
19379  *
19380  * for i in range(ndim - 1, -1, -1):
19381  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
19382  * c_stride = mslice.strides[i]
19383  * break
19384  */
19385  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
19386  if (__pyx_t_2) {
19387 
19388  /* "View.MemoryView":1121
19389  * for i in range(ndim - 1, -1, -1):
19390  * if mslice.shape[i] > 1:
19391  * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
19392  * break
19393  *
19394  */
19395  __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
19396 
19397  /* "View.MemoryView":1122
19398  * if mslice.shape[i] > 1:
19399  * c_stride = mslice.strides[i]
19400  * break # <<<<<<<<<<<<<<
19401  *
19402  * for i in range(ndim):
19403  */
19404  goto __pyx_L4_break;
19405 
19406  /* "View.MemoryView":1120
19407  *
19408  * for i in range(ndim - 1, -1, -1):
19409  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
19410  * c_stride = mslice.strides[i]
19411  * break
19412  */
19413  }
19414  }
19415  __pyx_L4_break:;
19416 
19417  /* "View.MemoryView":1124
19418  * break
19419  *
19420  * for i in range(ndim): # <<<<<<<<<<<<<<
19421  * if mslice.shape[i] > 1:
19422  * f_stride = mslice.strides[i]
19423  */
19424  __pyx_t_1 = __pyx_v_ndim;
19425  __pyx_t_3 = __pyx_t_1;
19426  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19427  __pyx_v_i = __pyx_t_4;
19428 
19429  /* "View.MemoryView":1125
19430  *
19431  * for i in range(ndim):
19432  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
19433  * f_stride = mslice.strides[i]
19434  * break
19435  */
19436  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
19437  if (__pyx_t_2) {
19438 
19439  /* "View.MemoryView":1126
19440  * for i in range(ndim):
19441  * if mslice.shape[i] > 1:
19442  * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
19443  * break
19444  *
19445  */
19446  __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
19447 
19448  /* "View.MemoryView":1127
19449  * if mslice.shape[i] > 1:
19450  * f_stride = mslice.strides[i]
19451  * break # <<<<<<<<<<<<<<
19452  *
19453  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
19454  */
19455  goto __pyx_L7_break;
19456 
19457  /* "View.MemoryView":1125
19458  *
19459  * for i in range(ndim):
19460  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
19461  * f_stride = mslice.strides[i]
19462  * break
19463  */
19464  }
19465  }
19466  __pyx_L7_break:;
19467 
19468  /* "View.MemoryView":1129
19469  * break
19470  *
19471  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
19472  * return 'C'
19473  * else:
19474  */
19475  __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
19476  if (__pyx_t_2) {
19477 
19478  /* "View.MemoryView":1130
19479  *
19480  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
19481  * return 'C' # <<<<<<<<<<<<<<
19482  * else:
19483  * return 'F'
19484  */
19485  __pyx_r = 'C';
19486  goto __pyx_L0;
19487 
19488  /* "View.MemoryView":1129
19489  * break
19490  *
19491  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
19492  * return 'C'
19493  * else:
19494  */
19495  }
19496 
19497  /* "View.MemoryView":1132
19498  * return 'C'
19499  * else:
19500  * return 'F' # <<<<<<<<<<<<<<
19501  *
19502  * @cython.cdivision(True)
19503  */
19504  /*else*/ {
19505  __pyx_r = 'F';
19506  goto __pyx_L0;
19507  }
19508 
19509  /* "View.MemoryView":1111
19510  *
19511  * @cname('__pyx_get_best_slice_order')
19512  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
19513  * """
19514  * Figure out the best memory access order for a given slice.
19515  */
19516 
19517  /* function exit code */
19518  __pyx_L0:;
19519  return __pyx_r;
19520 }
19521 
19522 /* "View.MemoryView":1135
19523  *
19524  * @cython.cdivision(True)
19525  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
19526  * char *dst_data, Py_ssize_t *dst_strides,
19527  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
19528  */
19529 
19530 static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
19531  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
19532  CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
19533  Py_ssize_t __pyx_v_dst_extent;
19534  Py_ssize_t __pyx_v_src_stride;
19535  Py_ssize_t __pyx_v_dst_stride;
19536  int __pyx_t_1;
19537  int __pyx_t_2;
19538  int __pyx_t_3;
19539  Py_ssize_t __pyx_t_4;
19540  Py_ssize_t __pyx_t_5;
19541  Py_ssize_t __pyx_t_6;
19542 
19543  /* "View.MemoryView":1142
19544  *
19545  * cdef Py_ssize_t i
19546  * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
19547  * cdef Py_ssize_t dst_extent = dst_shape[0]
19548  * cdef Py_ssize_t src_stride = src_strides[0]
19549  */
19550  __pyx_v_src_extent = (__pyx_v_src_shape[0]);
19551 
19552  /* "View.MemoryView":1143
19553  * cdef Py_ssize_t i
19554  * cdef Py_ssize_t src_extent = src_shape[0]
19555  * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
19556  * cdef Py_ssize_t src_stride = src_strides[0]
19557  * cdef Py_ssize_t dst_stride = dst_strides[0]
19558  */
19559  __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
19560 
19561  /* "View.MemoryView":1144
19562  * cdef Py_ssize_t src_extent = src_shape[0]
19563  * cdef Py_ssize_t dst_extent = dst_shape[0]
19564  * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
19565  * cdef Py_ssize_t dst_stride = dst_strides[0]
19566  *
19567  */
19568  __pyx_v_src_stride = (__pyx_v_src_strides[0]);
19569 
19570  /* "View.MemoryView":1145
19571  * cdef Py_ssize_t dst_extent = dst_shape[0]
19572  * cdef Py_ssize_t src_stride = src_strides[0]
19573  * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
19574  *
19575  * if ndim == 1:
19576  */
19577  __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
19578 
19579  /* "View.MemoryView":1147
19580  * cdef Py_ssize_t dst_stride = dst_strides[0]
19581  *
19582  * if ndim == 1: # <<<<<<<<<<<<<<
19583  * if (src_stride > 0 and dst_stride > 0 and
19584  * <size_t> src_stride == itemsize == <size_t> dst_stride):
19585  */
19586  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
19587  if (__pyx_t_1) {
19588 
19589  /* "View.MemoryView":1148
19590  *
19591  * if ndim == 1:
19592  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
19593  * <size_t> src_stride == itemsize == <size_t> dst_stride):
19594  * memcpy(dst_data, src_data, itemsize * dst_extent)
19595  */
19596  __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
19597  if (__pyx_t_2) {
19598  } else {
19599  __pyx_t_1 = __pyx_t_2;
19600  goto __pyx_L5_bool_binop_done;
19601  }
19602  __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
19603  if (__pyx_t_2) {
19604  } else {
19605  __pyx_t_1 = __pyx_t_2;
19606  goto __pyx_L5_bool_binop_done;
19607  }
19608 
19609  /* "View.MemoryView":1149
19610  * if ndim == 1:
19611  * if (src_stride > 0 and dst_stride > 0 and
19612  * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
19613  * memcpy(dst_data, src_data, itemsize * dst_extent)
19614  * else:
19615  */
19616  __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
19617  if (__pyx_t_2) {
19618  __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
19619  }
19620  __pyx_t_3 = (__pyx_t_2 != 0);
19621  __pyx_t_1 = __pyx_t_3;
19622  __pyx_L5_bool_binop_done:;
19623 
19624  /* "View.MemoryView":1148
19625  *
19626  * if ndim == 1:
19627  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
19628  * <size_t> src_stride == itemsize == <size_t> dst_stride):
19629  * memcpy(dst_data, src_data, itemsize * dst_extent)
19630  */
19631  if (__pyx_t_1) {
19632 
19633  /* "View.MemoryView":1150
19634  * if (src_stride > 0 and dst_stride > 0 and
19635  * <size_t> src_stride == itemsize == <size_t> dst_stride):
19636  * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
19637  * else:
19638  * for i in range(dst_extent):
19639  */
19640  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
19641 
19642  /* "View.MemoryView":1148
19643  *
19644  * if ndim == 1:
19645  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
19646  * <size_t> src_stride == itemsize == <size_t> dst_stride):
19647  * memcpy(dst_data, src_data, itemsize * dst_extent)
19648  */
19649  goto __pyx_L4;
19650  }
19651 
19652  /* "View.MemoryView":1152
19653  * memcpy(dst_data, src_data, itemsize * dst_extent)
19654  * else:
19655  * for i in range(dst_extent): # <<<<<<<<<<<<<<
19656  * memcpy(dst_data, src_data, itemsize)
19657  * src_data += src_stride
19658  */
19659  /*else*/ {
19660  __pyx_t_4 = __pyx_v_dst_extent;
19661  __pyx_t_5 = __pyx_t_4;
19662  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19663  __pyx_v_i = __pyx_t_6;
19664 
19665  /* "View.MemoryView":1153
19666  * else:
19667  * for i in range(dst_extent):
19668  * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
19669  * src_data += src_stride
19670  * dst_data += dst_stride
19671  */
19672  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
19673 
19674  /* "View.MemoryView":1154
19675  * for i in range(dst_extent):
19676  * memcpy(dst_data, src_data, itemsize)
19677  * src_data += src_stride # <<<<<<<<<<<<<<
19678  * dst_data += dst_stride
19679  * else:
19680  */
19681  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
19682 
19683  /* "View.MemoryView":1155
19684  * memcpy(dst_data, src_data, itemsize)
19685  * src_data += src_stride
19686  * dst_data += dst_stride # <<<<<<<<<<<<<<
19687  * else:
19688  * for i in range(dst_extent):
19689  */
19690  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
19691  }
19692  }
19693  __pyx_L4:;
19694 
19695  /* "View.MemoryView":1147
19696  * cdef Py_ssize_t dst_stride = dst_strides[0]
19697  *
19698  * if ndim == 1: # <<<<<<<<<<<<<<
19699  * if (src_stride > 0 and dst_stride > 0 and
19700  * <size_t> src_stride == itemsize == <size_t> dst_stride):
19701  */
19702  goto __pyx_L3;
19703  }
19704 
19705  /* "View.MemoryView":1157
19706  * dst_data += dst_stride
19707  * else:
19708  * for i in range(dst_extent): # <<<<<<<<<<<<<<
19709  * _copy_strided_to_strided(src_data, src_strides + 1,
19710  * dst_data, dst_strides + 1,
19711  */
19712  /*else*/ {
19713  __pyx_t_4 = __pyx_v_dst_extent;
19714  __pyx_t_5 = __pyx_t_4;
19715  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19716  __pyx_v_i = __pyx_t_6;
19717 
19718  /* "View.MemoryView":1158
19719  * else:
19720  * for i in range(dst_extent):
19721  * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
19722  * dst_data, dst_strides + 1,
19723  * src_shape + 1, dst_shape + 1,
19724  */
19725  _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
19726 
19727  /* "View.MemoryView":1162
19728  * src_shape + 1, dst_shape + 1,
19729  * ndim - 1, itemsize)
19730  * src_data += src_stride # <<<<<<<<<<<<<<
19731  * dst_data += dst_stride
19732  *
19733  */
19734  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
19735 
19736  /* "View.MemoryView":1163
19737  * ndim - 1, itemsize)
19738  * src_data += src_stride
19739  * dst_data += dst_stride # <<<<<<<<<<<<<<
19740  *
19741  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
19742  */
19743  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
19744  }
19745  }
19746  __pyx_L3:;
19747 
19748  /* "View.MemoryView":1135
19749  *
19750  * @cython.cdivision(True)
19751  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
19752  * char *dst_data, Py_ssize_t *dst_strides,
19753  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
19754  */
19755 
19756  /* function exit code */
19757 }
19758 
19759 /* "View.MemoryView":1165
19760  * dst_data += dst_stride
19761  *
19762  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19763  * __Pyx_memviewslice *dst,
19764  * int ndim, size_t itemsize) nogil:
19765  */
19766 
19767 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
19768 
19769  /* "View.MemoryView":1168
19770  * __Pyx_memviewslice *dst,
19771  * int ndim, size_t itemsize) nogil:
19772  * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
19773  * src.shape, dst.shape, ndim, itemsize)
19774  *
19775  */
19776  _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
19777 
19778  /* "View.MemoryView":1165
19779  * dst_data += dst_stride
19780  *
19781  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19782  * __Pyx_memviewslice *dst,
19783  * int ndim, size_t itemsize) nogil:
19784  */
19785 
19786  /* function exit code */
19787 }
19788 
19789 /* "View.MemoryView":1172
19790  *
19791  * @cname('__pyx_memoryview_slice_get_size')
19792  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
19793  * "Return the size of the memory occupied by the slice in number of bytes"
19794  * cdef int i
19795  */
19796 
19797 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
19798  int __pyx_v_i;
19799  Py_ssize_t __pyx_v_size;
19800  Py_ssize_t __pyx_r;
19801  Py_ssize_t __pyx_t_1;
19802  int __pyx_t_2;
19803  int __pyx_t_3;
19804  int __pyx_t_4;
19805 
19806  /* "View.MemoryView":1175
19807  * "Return the size of the memory occupied by the slice in number of bytes"
19808  * cdef int i
19809  * cdef Py_ssize_t size = src.memview.view.itemsize # <<<<<<<<<<<<<<
19810  *
19811  * for i in range(ndim):
19812  */
19813  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
19814  __pyx_v_size = __pyx_t_1;
19815 
19816  /* "View.MemoryView":1177
19817  * cdef Py_ssize_t size = src.memview.view.itemsize
19818  *
19819  * for i in range(ndim): # <<<<<<<<<<<<<<
19820  * size *= src.shape[i]
19821  *
19822  */
19823  __pyx_t_2 = __pyx_v_ndim;
19824  __pyx_t_3 = __pyx_t_2;
19825  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19826  __pyx_v_i = __pyx_t_4;
19827 
19828  /* "View.MemoryView":1178
19829  *
19830  * for i in range(ndim):
19831  * size *= src.shape[i] # <<<<<<<<<<<<<<
19832  *
19833  * return size
19834  */
19835  __pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i]));
19836  }
19837 
19838  /* "View.MemoryView":1180
19839  * size *= src.shape[i]
19840  *
19841  * return size # <<<<<<<<<<<<<<
19842  *
19843  * @cname('__pyx_fill_contig_strides_array')
19844  */
19845  __pyx_r = __pyx_v_size;
19846  goto __pyx_L0;
19847 
19848  /* "View.MemoryView":1172
19849  *
19850  * @cname('__pyx_memoryview_slice_get_size')
19851  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
19852  * "Return the size of the memory occupied by the slice in number of bytes"
19853  * cdef int i
19854  */
19855 
19856  /* function exit code */
19857  __pyx_L0:;
19858  return __pyx_r;
19859 }
19860 
19861 /* "View.MemoryView":1183
19862  *
19863  * @cname('__pyx_fill_contig_strides_array')
19864  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
19865  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
19866  * int ndim, char order) nogil:
19867  */
19868 
19869 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
19870  int __pyx_v_idx;
19871  Py_ssize_t __pyx_r;
19872  int __pyx_t_1;
19873  int __pyx_t_2;
19874  int __pyx_t_3;
19875  int __pyx_t_4;
19876 
19877  /* "View.MemoryView":1192
19878  * cdef int idx
19879  *
19880  * if order == 'F': # <<<<<<<<<<<<<<
19881  * for idx in range(ndim):
19882  * strides[idx] = stride
19883  */
19884  __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
19885  if (__pyx_t_1) {
19886 
19887  /* "View.MemoryView":1193
19888  *
19889  * if order == 'F':
19890  * for idx in range(ndim): # <<<<<<<<<<<<<<
19891  * strides[idx] = stride
19892  * stride = stride * shape[idx]
19893  */
19894  __pyx_t_2 = __pyx_v_ndim;
19895  __pyx_t_3 = __pyx_t_2;
19896  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19897  __pyx_v_idx = __pyx_t_4;
19898 
19899  /* "View.MemoryView":1194
19900  * if order == 'F':
19901  * for idx in range(ndim):
19902  * strides[idx] = stride # <<<<<<<<<<<<<<
19903  * stride = stride * shape[idx]
19904  * else:
19905  */
19906  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
19907 
19908  /* "View.MemoryView":1195
19909  * for idx in range(ndim):
19910  * strides[idx] = stride
19911  * stride = stride * shape[idx] # <<<<<<<<<<<<<<
19912  * else:
19913  * for idx in range(ndim - 1, -1, -1):
19914  */
19915  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
19916  }
19917 
19918  /* "View.MemoryView":1192
19919  * cdef int idx
19920  *
19921  * if order == 'F': # <<<<<<<<<<<<<<
19922  * for idx in range(ndim):
19923  * strides[idx] = stride
19924  */
19925  goto __pyx_L3;
19926  }
19927 
19928  /* "View.MemoryView":1197
19929  * stride = stride * shape[idx]
19930  * else:
19931  * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
19932  * strides[idx] = stride
19933  * stride = stride * shape[idx]
19934  */
19935  /*else*/ {
19936  for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
19937  __pyx_v_idx = __pyx_t_2;
19938 
19939  /* "View.MemoryView":1198
19940  * else:
19941  * for idx in range(ndim - 1, -1, -1):
19942  * strides[idx] = stride # <<<<<<<<<<<<<<
19943  * stride = stride * shape[idx]
19944  *
19945  */
19946  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
19947 
19948  /* "View.MemoryView":1199
19949  * for idx in range(ndim - 1, -1, -1):
19950  * strides[idx] = stride
19951  * stride = stride * shape[idx] # <<<<<<<<<<<<<<
19952  *
19953  * return stride
19954  */
19955  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
19956  }
19957  }
19958  __pyx_L3:;
19959 
19960  /* "View.MemoryView":1201
19961  * stride = stride * shape[idx]
19962  *
19963  * return stride # <<<<<<<<<<<<<<
19964  *
19965  * @cname('__pyx_memoryview_copy_data_to_temp')
19966  */
19967  __pyx_r = __pyx_v_stride;
19968  goto __pyx_L0;
19969 
19970  /* "View.MemoryView":1183
19971  *
19972  * @cname('__pyx_fill_contig_strides_array')
19973  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
19974  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
19975  * int ndim, char order) nogil:
19976  */
19977 
19978  /* function exit code */
19979  __pyx_L0:;
19980  return __pyx_r;
19981 }
19982 
19983 /* "View.MemoryView":1204
19984  *
19985  * @cname('__pyx_memoryview_copy_data_to_temp')
19986  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19987  * __Pyx_memviewslice *tmpslice,
19988  * char order,
19989  */
19990 
19991 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
19992  int __pyx_v_i;
19993  void *__pyx_v_result;
19994  size_t __pyx_v_itemsize;
19995  size_t __pyx_v_size;
19996  void *__pyx_r;
19997  Py_ssize_t __pyx_t_1;
19998  int __pyx_t_2;
19999  int __pyx_t_3;
20000  struct __pyx_memoryview_obj *__pyx_t_4;
20001  int __pyx_t_5;
20002  int __pyx_t_6;
20003 
20004  /* "View.MemoryView":1215
20005  * cdef void *result
20006  *
20007  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
20008  * cdef size_t size = slice_get_size(src, ndim)
20009  *
20010  */
20011  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
20012  __pyx_v_itemsize = __pyx_t_1;
20013 
20014  /* "View.MemoryView":1216
20015  *
20016  * cdef size_t itemsize = src.memview.view.itemsize
20017  * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
20018  *
20019  * result = malloc(size)
20020  */
20021  __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
20022 
20023  /* "View.MemoryView":1218
20024  * cdef size_t size = slice_get_size(src, ndim)
20025  *
20026  * result = malloc(size) # <<<<<<<<<<<<<<
20027  * if not result:
20028  * _err(MemoryError, NULL)
20029  */
20030  __pyx_v_result = malloc(__pyx_v_size);
20031 
20032  /* "View.MemoryView":1219
20033  *
20034  * result = malloc(size)
20035  * if not result: # <<<<<<<<<<<<<<
20036  * _err(MemoryError, NULL)
20037  *
20038  */
20039  __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
20040  if (__pyx_t_2) {
20041 
20042  /* "View.MemoryView":1220
20043  * result = malloc(size)
20044  * if not result:
20045  * _err(MemoryError, NULL) # <<<<<<<<<<<<<<
20046  *
20047  *
20048  */
20049  __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1220, __pyx_L1_error)
20050 
20051  /* "View.MemoryView":1219
20052  *
20053  * result = malloc(size)
20054  * if not result: # <<<<<<<<<<<<<<
20055  * _err(MemoryError, NULL)
20056  *
20057  */
20058  }
20059 
20060  /* "View.MemoryView":1223
20061  *
20062  *
20063  * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
20064  * tmpslice.memview = src.memview
20065  * for i in range(ndim):
20066  */
20067  __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
20068 
20069  /* "View.MemoryView":1224
20070  *
20071  * tmpslice.data = <char *> result
20072  * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
20073  * for i in range(ndim):
20074  * tmpslice.shape[i] = src.shape[i]
20075  */
20076  __pyx_t_4 = __pyx_v_src->memview;
20077  __pyx_v_tmpslice->memview = __pyx_t_4;
20078 
20079  /* "View.MemoryView":1225
20080  * tmpslice.data = <char *> result
20081  * tmpslice.memview = src.memview
20082  * for i in range(ndim): # <<<<<<<<<<<<<<
20083  * tmpslice.shape[i] = src.shape[i]
20084  * tmpslice.suboffsets[i] = -1
20085  */
20086  __pyx_t_3 = __pyx_v_ndim;
20087  __pyx_t_5 = __pyx_t_3;
20088  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
20089  __pyx_v_i = __pyx_t_6;
20090 
20091  /* "View.MemoryView":1226
20092  * tmpslice.memview = src.memview
20093  * for i in range(ndim):
20094  * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
20095  * tmpslice.suboffsets[i] = -1
20096  *
20097  */
20098  (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
20099 
20100  /* "View.MemoryView":1227
20101  * for i in range(ndim):
20102  * tmpslice.shape[i] = src.shape[i]
20103  * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
20104  *
20105  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
20106  */
20107  (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
20108  }
20109 
20110  /* "View.MemoryView":1229
20111  * tmpslice.suboffsets[i] = -1
20112  *
20113  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
20114  * ndim, order)
20115  *
20116  */
20117  (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
20118 
20119  /* "View.MemoryView":1233
20120  *
20121  *
20122  * for i in range(ndim): # <<<<<<<<<<<<<<
20123  * if tmpslice.shape[i] == 1:
20124  * tmpslice.strides[i] = 0
20125  */
20126  __pyx_t_3 = __pyx_v_ndim;
20127  __pyx_t_5 = __pyx_t_3;
20128  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
20129  __pyx_v_i = __pyx_t_6;
20130 
20131  /* "View.MemoryView":1234
20132  *
20133  * for i in range(ndim):
20134  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
20135  * tmpslice.strides[i] = 0
20136  *
20137  */
20138  __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
20139  if (__pyx_t_2) {
20140 
20141  /* "View.MemoryView":1235
20142  * for i in range(ndim):
20143  * if tmpslice.shape[i] == 1:
20144  * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
20145  *
20146  * if slice_is_contig(src[0], order, ndim):
20147  */
20148  (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
20149 
20150  /* "View.MemoryView":1234
20151  *
20152  * for i in range(ndim):
20153  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
20154  * tmpslice.strides[i] = 0
20155  *
20156  */
20157  }
20158  }
20159 
20160  /* "View.MemoryView":1237
20161  * tmpslice.strides[i] = 0
20162  *
20163  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
20164  * memcpy(result, src.data, size)
20165  * else:
20166  */
20167  __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
20168  if (__pyx_t_2) {
20169 
20170  /* "View.MemoryView":1238
20171  *
20172  * if slice_is_contig(src[0], order, ndim):
20173  * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
20174  * else:
20175  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
20176  */
20177  (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
20178 
20179  /* "View.MemoryView":1237
20180  * tmpslice.strides[i] = 0
20181  *
20182  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
20183  * memcpy(result, src.data, size)
20184  * else:
20185  */
20186  goto __pyx_L9;
20187  }
20188 
20189  /* "View.MemoryView":1240
20190  * memcpy(result, src.data, size)
20191  * else:
20192  * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
20193  *
20194  * return result
20195  */
20196  /*else*/ {
20197  copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
20198  }
20199  __pyx_L9:;
20200 
20201  /* "View.MemoryView":1242
20202  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
20203  *
20204  * return result # <<<<<<<<<<<<<<
20205  *
20206  *
20207  */
20208  __pyx_r = __pyx_v_result;
20209  goto __pyx_L0;
20210 
20211  /* "View.MemoryView":1204
20212  *
20213  * @cname('__pyx_memoryview_copy_data_to_temp')
20214  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
20215  * __Pyx_memviewslice *tmpslice,
20216  * char order,
20217  */
20218 
20219  /* function exit code */
20220  __pyx_L1_error:;
20221  {
20222  #ifdef WITH_THREAD
20223  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20224  #endif
20225  __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
20226  #ifdef WITH_THREAD
20227  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20228  #endif
20229  }
20230  __pyx_r = NULL;
20231  __pyx_L0:;
20232  return __pyx_r;
20233 }
20234 
20235 /* "View.MemoryView":1247
20236  *
20237  * @cname('__pyx_memoryview_err_extents')
20238  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
20239  * Py_ssize_t extent2) except -1 with gil:
20240  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
20241  */
20242 
20243 static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
20244  int __pyx_r;
20245  __Pyx_RefNannyDeclarations
20246  PyObject *__pyx_t_1 = NULL;
20247  PyObject *__pyx_t_2 = NULL;
20248  PyObject *__pyx_t_3 = NULL;
20249  PyObject *__pyx_t_4 = NULL;
20250  #ifdef WITH_THREAD
20251  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20252  #endif
20253  __Pyx_RefNannySetupContext("_err_extents", 0);
20254 
20255  /* "View.MemoryView":1250
20256  * Py_ssize_t extent2) except -1 with gil:
20257  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
20258  * (i, extent1, extent2)) # <<<<<<<<<<<<<<
20259  *
20260  * @cname('__pyx_memoryview_err_dim')
20261  */
20262  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1250, __pyx_L1_error)
20263  __Pyx_GOTREF(__pyx_t_1);
20264  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1250, __pyx_L1_error)
20265  __Pyx_GOTREF(__pyx_t_2);
20266  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1250, __pyx_L1_error)
20267  __Pyx_GOTREF(__pyx_t_3);
20268  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1250, __pyx_L1_error)
20269  __Pyx_GOTREF(__pyx_t_4);
20270  __Pyx_GIVEREF(__pyx_t_1);
20271  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
20272  __Pyx_GIVEREF(__pyx_t_2);
20273  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
20274  __Pyx_GIVEREF(__pyx_t_3);
20275  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
20276  __pyx_t_1 = 0;
20277  __pyx_t_2 = 0;
20278  __pyx_t_3 = 0;
20279 
20280  /* "View.MemoryView":1249
20281  * cdef int _err_extents(int i, Py_ssize_t extent1,
20282  * Py_ssize_t extent2) except -1 with gil:
20283  * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<<
20284  * (i, extent1, extent2))
20285  *
20286  */
20287  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1249, __pyx_L1_error)
20288  __Pyx_GOTREF(__pyx_t_3);
20289  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20290  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1249, __pyx_L1_error)
20291  __Pyx_GOTREF(__pyx_t_4);
20292  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20293  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
20294  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20295  __PYX_ERR(1, 1249, __pyx_L1_error)
20296 
20297  /* "View.MemoryView":1247
20298  *
20299  * @cname('__pyx_memoryview_err_extents')
20300  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
20301  * Py_ssize_t extent2) except -1 with gil:
20302  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
20303  */
20304 
20305  /* function exit code */
20306  __pyx_L1_error:;
20307  __Pyx_XDECREF(__pyx_t_1);
20308  __Pyx_XDECREF(__pyx_t_2);
20309  __Pyx_XDECREF(__pyx_t_3);
20310  __Pyx_XDECREF(__pyx_t_4);
20311  __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
20312  __pyx_r = -1;
20313  __Pyx_RefNannyFinishContext();
20314  #ifdef WITH_THREAD
20315  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20316  #endif
20317  return __pyx_r;
20318 }
20319 
20320 /* "View.MemoryView":1253
20321  *
20322  * @cname('__pyx_memoryview_err_dim')
20323  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
20324  * raise error(msg.decode('ascii') % dim)
20325  *
20326  */
20327 
20328 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
20329  int __pyx_r;
20330  __Pyx_RefNannyDeclarations
20331  PyObject *__pyx_t_1 = NULL;
20332  PyObject *__pyx_t_2 = NULL;
20333  PyObject *__pyx_t_3 = NULL;
20334  PyObject *__pyx_t_4 = NULL;
20335  PyObject *__pyx_t_5 = NULL;
20336  #ifdef WITH_THREAD
20337  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20338  #endif
20339  __Pyx_RefNannySetupContext("_err_dim", 0);
20340  __Pyx_INCREF(__pyx_v_error);
20341 
20342  /* "View.MemoryView":1254
20343  * @cname('__pyx_memoryview_err_dim')
20344  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
20345  * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<<
20346  *
20347  * @cname('__pyx_memoryview_err')
20348  */
20349  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1254, __pyx_L1_error)
20350  __Pyx_GOTREF(__pyx_t_2);
20351  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1254, __pyx_L1_error)
20352  __Pyx_GOTREF(__pyx_t_3);
20353  __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1254, __pyx_L1_error)
20354  __Pyx_GOTREF(__pyx_t_4);
20355  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20356  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20357  __Pyx_INCREF(__pyx_v_error);
20358  __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
20359  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
20360  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
20361  if (likely(__pyx_t_2)) {
20362  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
20363  __Pyx_INCREF(__pyx_t_2);
20364  __Pyx_INCREF(function);
20365  __Pyx_DECREF_SET(__pyx_t_3, function);
20366  }
20367  }
20368  if (!__pyx_t_2) {
20369  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
20370  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20371  __Pyx_GOTREF(__pyx_t_1);
20372  } else {
20373  #if CYTHON_FAST_PYCALL
20374  if (PyFunction_Check(__pyx_t_3)) {
20375  PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
20376  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
20377  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20378  __Pyx_GOTREF(__pyx_t_1);
20379  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20380  } else
20381  #endif
20382  #if CYTHON_FAST_PYCCALL
20383  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
20384  PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
20385  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
20386  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20387  __Pyx_GOTREF(__pyx_t_1);
20388  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20389  } else
20390  #endif
20391  {
20392  __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1254, __pyx_L1_error)
20393  __Pyx_GOTREF(__pyx_t_5);
20394  __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
20395  __Pyx_GIVEREF(__pyx_t_4);
20396  PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
20397  __pyx_t_4 = 0;
20398  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
20399  __Pyx_GOTREF(__pyx_t_1);
20400  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20401  }
20402  }
20403  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20404  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
20405  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20406  __PYX_ERR(1, 1254, __pyx_L1_error)
20407 
20408  /* "View.MemoryView":1253
20409  *
20410  * @cname('__pyx_memoryview_err_dim')
20411  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
20412  * raise error(msg.decode('ascii') % dim)
20413  *
20414  */
20415 
20416  /* function exit code */
20417  __pyx_L1_error:;
20418  __Pyx_XDECREF(__pyx_t_1);
20419  __Pyx_XDECREF(__pyx_t_2);
20420  __Pyx_XDECREF(__pyx_t_3);
20421  __Pyx_XDECREF(__pyx_t_4);
20422  __Pyx_XDECREF(__pyx_t_5);
20423  __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
20424  __pyx_r = -1;
20425  __Pyx_XDECREF(__pyx_v_error);
20426  __Pyx_RefNannyFinishContext();
20427  #ifdef WITH_THREAD
20428  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20429  #endif
20430  return __pyx_r;
20431 }
20432 
20433 /* "View.MemoryView":1257
20434  *
20435  * @cname('__pyx_memoryview_err')
20436  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
20437  * if msg != NULL:
20438  * raise error(msg.decode('ascii'))
20439  */
20440 
20441 static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
20442  int __pyx_r;
20443  __Pyx_RefNannyDeclarations
20444  int __pyx_t_1;
20445  PyObject *__pyx_t_2 = NULL;
20446  PyObject *__pyx_t_3 = NULL;
20447  PyObject *__pyx_t_4 = NULL;
20448  PyObject *__pyx_t_5 = NULL;
20449  PyObject *__pyx_t_6 = NULL;
20450  #ifdef WITH_THREAD
20451  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20452  #endif
20453  __Pyx_RefNannySetupContext("_err", 0);
20454  __Pyx_INCREF(__pyx_v_error);
20455 
20456  /* "View.MemoryView":1258
20457  * @cname('__pyx_memoryview_err')
20458  * cdef int _err(object error, char *msg) except -1 with gil:
20459  * if msg != NULL: # <<<<<<<<<<<<<<
20460  * raise error(msg.decode('ascii'))
20461  * else:
20462  */
20463  __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
20464  if (unlikely(__pyx_t_1)) {
20465 
20466  /* "View.MemoryView":1259
20467  * cdef int _err(object error, char *msg) except -1 with gil:
20468  * if msg != NULL:
20469  * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<<
20470  * else:
20471  * raise error
20472  */
20473  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1259, __pyx_L1_error)
20474  __Pyx_GOTREF(__pyx_t_3);
20475  __Pyx_INCREF(__pyx_v_error);
20476  __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
20477  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
20478  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
20479  if (likely(__pyx_t_5)) {
20480  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
20481  __Pyx_INCREF(__pyx_t_5);
20482  __Pyx_INCREF(function);
20483  __Pyx_DECREF_SET(__pyx_t_4, function);
20484  }
20485  }
20486  if (!__pyx_t_5) {
20487  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1259, __pyx_L1_error)
20488  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20489  __Pyx_GOTREF(__pyx_t_2);
20490  } else {
20491  #if CYTHON_FAST_PYCALL
20492  if (PyFunction_Check(__pyx_t_4)) {
20493  PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
20494  __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1259, __pyx_L1_error)
20495  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20496  __Pyx_GOTREF(__pyx_t_2);
20497  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20498  } else
20499  #endif
20500  #if CYTHON_FAST_PYCCALL
20501  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
20502  PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
20503  __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1259, __pyx_L1_error)
20504  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20505  __Pyx_GOTREF(__pyx_t_2);
20506  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20507  } else
20508  #endif
20509  {
20510  __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1259, __pyx_L1_error)
20511  __Pyx_GOTREF(__pyx_t_6);
20512  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
20513  __Pyx_GIVEREF(__pyx_t_3);
20514  PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
20515  __pyx_t_3 = 0;
20516  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1259, __pyx_L1_error)
20517  __Pyx_GOTREF(__pyx_t_2);
20518  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20519  }
20520  }
20521  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20522  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
20523  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20524  __PYX_ERR(1, 1259, __pyx_L1_error)
20525 
20526  /* "View.MemoryView":1258
20527  * @cname('__pyx_memoryview_err')
20528  * cdef int _err(object error, char *msg) except -1 with gil:
20529  * if msg != NULL: # <<<<<<<<<<<<<<
20530  * raise error(msg.decode('ascii'))
20531  * else:
20532  */
20533  }
20534 
20535  /* "View.MemoryView":1261
20536  * raise error(msg.decode('ascii'))
20537  * else:
20538  * raise error # <<<<<<<<<<<<<<
20539  *
20540  * @cname('__pyx_memoryview_copy_contents')
20541  */
20542  /*else*/ {
20543  __Pyx_Raise(__pyx_v_error, 0, 0, 0);
20544  __PYX_ERR(1, 1261, __pyx_L1_error)
20545  }
20546 
20547  /* "View.MemoryView":1257
20548  *
20549  * @cname('__pyx_memoryview_err')
20550  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
20551  * if msg != NULL:
20552  * raise error(msg.decode('ascii'))
20553  */
20554 
20555  /* function exit code */
20556  __pyx_L1_error:;
20557  __Pyx_XDECREF(__pyx_t_2);
20558  __Pyx_XDECREF(__pyx_t_3);
20559  __Pyx_XDECREF(__pyx_t_4);
20560  __Pyx_XDECREF(__pyx_t_5);
20561  __Pyx_XDECREF(__pyx_t_6);
20562  __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
20563  __pyx_r = -1;
20564  __Pyx_XDECREF(__pyx_v_error);
20565  __Pyx_RefNannyFinishContext();
20566  #ifdef WITH_THREAD
20567  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20568  #endif
20569  return __pyx_r;
20570 }
20571 
20572 /* "View.MemoryView":1264
20573  *
20574  * @cname('__pyx_memoryview_copy_contents')
20575  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
20576  * __Pyx_memviewslice dst,
20577  * int src_ndim, int dst_ndim,
20578  */
20579 
20580 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
20581  void *__pyx_v_tmpdata;
20582  size_t __pyx_v_itemsize;
20583  int __pyx_v_i;
20584  char __pyx_v_order;
20585  int __pyx_v_broadcasting;
20586  int __pyx_v_direct_copy;
20587  __Pyx_memviewslice __pyx_v_tmp;
20588  int __pyx_v_ndim;
20589  int __pyx_r;
20590  Py_ssize_t __pyx_t_1;
20591  int __pyx_t_2;
20592  int __pyx_t_3;
20593  int __pyx_t_4;
20594  int __pyx_t_5;
20595  int __pyx_t_6;
20596  void *__pyx_t_7;
20597  int __pyx_t_8;
20598 
20599  /* "View.MemoryView":1272
20600  * Check for overlapping memory and verify the shapes.
20601  * """
20602  * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
20603  * cdef size_t itemsize = src.memview.view.itemsize
20604  * cdef int i
20605  */
20606  __pyx_v_tmpdata = NULL;
20607 
20608  /* "View.MemoryView":1273
20609  * """
20610  * cdef void *tmpdata = NULL
20611  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
20612  * cdef int i
20613  * cdef char order = get_best_order(&src, src_ndim)
20614  */
20615  __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
20616  __pyx_v_itemsize = __pyx_t_1;
20617 
20618  /* "View.MemoryView":1275
20619  * cdef size_t itemsize = src.memview.view.itemsize
20620  * cdef int i
20621  * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
20622  * cdef bint broadcasting = False
20623  * cdef bint direct_copy = False
20624  */
20625  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
20626 
20627  /* "View.MemoryView":1276
20628  * cdef int i
20629  * cdef char order = get_best_order(&src, src_ndim)
20630  * cdef bint broadcasting = False # <<<<<<<<<<<<<<
20631  * cdef bint direct_copy = False
20632  * cdef __Pyx_memviewslice tmp
20633  */
20634  __pyx_v_broadcasting = 0;
20635 
20636  /* "View.MemoryView":1277
20637  * cdef char order = get_best_order(&src, src_ndim)
20638  * cdef bint broadcasting = False
20639  * cdef bint direct_copy = False # <<<<<<<<<<<<<<
20640  * cdef __Pyx_memviewslice tmp
20641  *
20642  */
20643  __pyx_v_direct_copy = 0;
20644 
20645  /* "View.MemoryView":1280
20646  * cdef __Pyx_memviewslice tmp
20647  *
20648  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
20649  * broadcast_leading(&src, src_ndim, dst_ndim)
20650  * elif dst_ndim < src_ndim:
20651  */
20652  __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
20653  if (__pyx_t_2) {
20654 
20655  /* "View.MemoryView":1281
20656  *
20657  * if src_ndim < dst_ndim:
20658  * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
20659  * elif dst_ndim < src_ndim:
20660  * broadcast_leading(&dst, dst_ndim, src_ndim)
20661  */
20662  __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
20663 
20664  /* "View.MemoryView":1280
20665  * cdef __Pyx_memviewslice tmp
20666  *
20667  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
20668  * broadcast_leading(&src, src_ndim, dst_ndim)
20669  * elif dst_ndim < src_ndim:
20670  */
20671  goto __pyx_L3;
20672  }
20673 
20674  /* "View.MemoryView":1282
20675  * if src_ndim < dst_ndim:
20676  * broadcast_leading(&src, src_ndim, dst_ndim)
20677  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
20678  * broadcast_leading(&dst, dst_ndim, src_ndim)
20679  *
20680  */
20681  __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
20682  if (__pyx_t_2) {
20683 
20684  /* "View.MemoryView":1283
20685  * broadcast_leading(&src, src_ndim, dst_ndim)
20686  * elif dst_ndim < src_ndim:
20687  * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
20688  *
20689  * cdef int ndim = max(src_ndim, dst_ndim)
20690  */
20691  __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
20692 
20693  /* "View.MemoryView":1282
20694  * if src_ndim < dst_ndim:
20695  * broadcast_leading(&src, src_ndim, dst_ndim)
20696  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
20697  * broadcast_leading(&dst, dst_ndim, src_ndim)
20698  *
20699  */
20700  }
20701  __pyx_L3:;
20702 
20703  /* "View.MemoryView":1285
20704  * broadcast_leading(&dst, dst_ndim, src_ndim)
20705  *
20706  * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
20707  *
20708  * for i in range(ndim):
20709  */
20710  __pyx_t_3 = __pyx_v_dst_ndim;
20711  __pyx_t_4 = __pyx_v_src_ndim;
20712  if (((__pyx_t_3 > __pyx_t_4) != 0)) {
20713  __pyx_t_5 = __pyx_t_3;
20714  } else {
20715  __pyx_t_5 = __pyx_t_4;
20716  }
20717  __pyx_v_ndim = __pyx_t_5;
20718 
20719  /* "View.MemoryView":1287
20720  * cdef int ndim = max(src_ndim, dst_ndim)
20721  *
20722  * for i in range(ndim): # <<<<<<<<<<<<<<
20723  * if src.shape[i] != dst.shape[i]:
20724  * if src.shape[i] == 1:
20725  */
20726  __pyx_t_5 = __pyx_v_ndim;
20727  __pyx_t_3 = __pyx_t_5;
20728  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20729  __pyx_v_i = __pyx_t_4;
20730 
20731  /* "View.MemoryView":1288
20732  *
20733  * for i in range(ndim):
20734  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
20735  * if src.shape[i] == 1:
20736  * broadcasting = True
20737  */
20738  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
20739  if (__pyx_t_2) {
20740 
20741  /* "View.MemoryView":1289
20742  * for i in range(ndim):
20743  * if src.shape[i] != dst.shape[i]:
20744  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
20745  * broadcasting = True
20746  * src.strides[i] = 0
20747  */
20748  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
20749  if (__pyx_t_2) {
20750 
20751  /* "View.MemoryView":1290
20752  * if src.shape[i] != dst.shape[i]:
20753  * if src.shape[i] == 1:
20754  * broadcasting = True # <<<<<<<<<<<<<<
20755  * src.strides[i] = 0
20756  * else:
20757  */
20758  __pyx_v_broadcasting = 1;
20759 
20760  /* "View.MemoryView":1291
20761  * if src.shape[i] == 1:
20762  * broadcasting = True
20763  * src.strides[i] = 0 # <<<<<<<<<<<<<<
20764  * else:
20765  * _err_extents(i, dst.shape[i], src.shape[i])
20766  */
20767  (__pyx_v_src.strides[__pyx_v_i]) = 0;
20768 
20769  /* "View.MemoryView":1289
20770  * for i in range(ndim):
20771  * if src.shape[i] != dst.shape[i]:
20772  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
20773  * broadcasting = True
20774  * src.strides[i] = 0
20775  */
20776  goto __pyx_L7;
20777  }
20778 
20779  /* "View.MemoryView":1293
20780  * src.strides[i] = 0
20781  * else:
20782  * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
20783  *
20784  * if src.suboffsets[i] >= 0:
20785  */
20786  /*else*/ {
20787  __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1293, __pyx_L1_error)
20788  }
20789  __pyx_L7:;
20790 
20791  /* "View.MemoryView":1288
20792  *
20793  * for i in range(ndim):
20794  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
20795  * if src.shape[i] == 1:
20796  * broadcasting = True
20797  */
20798  }
20799 
20800  /* "View.MemoryView":1295
20801  * _err_extents(i, dst.shape[i], src.shape[i])
20802  *
20803  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
20804  * _err_dim(ValueError, "Dimension %d is not direct", i)
20805  *
20806  */
20807  __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
20808  if (__pyx_t_2) {
20809 
20810  /* "View.MemoryView":1296
20811  *
20812  * if src.suboffsets[i] >= 0:
20813  * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
20814  *
20815  * if slices_overlap(&src, &dst, ndim, itemsize):
20816  */
20817  __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1296, __pyx_L1_error)
20818 
20819  /* "View.MemoryView":1295
20820  * _err_extents(i, dst.shape[i], src.shape[i])
20821  *
20822  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
20823  * _err_dim(ValueError, "Dimension %d is not direct", i)
20824  *
20825  */
20826  }
20827  }
20828 
20829  /* "View.MemoryView":1298
20830  * _err_dim(ValueError, "Dimension %d is not direct", i)
20831  *
20832  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
20833  *
20834  * if not slice_is_contig(src, order, ndim):
20835  */
20836  __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
20837  if (__pyx_t_2) {
20838 
20839  /* "View.MemoryView":1300
20840  * if slices_overlap(&src, &dst, ndim, itemsize):
20841  *
20842  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
20843  * order = get_best_order(&dst, ndim)
20844  *
20845  */
20846  __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
20847  if (__pyx_t_2) {
20848 
20849  /* "View.MemoryView":1301
20850  *
20851  * if not slice_is_contig(src, order, ndim):
20852  * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
20853  *
20854  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
20855  */
20856  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
20857 
20858  /* "View.MemoryView":1300
20859  * if slices_overlap(&src, &dst, ndim, itemsize):
20860  *
20861  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
20862  * order = get_best_order(&dst, ndim)
20863  *
20864  */
20865  }
20866 
20867  /* "View.MemoryView":1303
20868  * order = get_best_order(&dst, ndim)
20869  *
20870  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
20871  * src = tmp
20872  *
20873  */
20874  __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(1, 1303, __pyx_L1_error)
20875  __pyx_v_tmpdata = __pyx_t_7;
20876 
20877  /* "View.MemoryView":1304
20878  *
20879  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
20880  * src = tmp # <<<<<<<<<<<<<<
20881  *
20882  * if not broadcasting:
20883  */
20884  __pyx_v_src = __pyx_v_tmp;
20885 
20886  /* "View.MemoryView":1298
20887  * _err_dim(ValueError, "Dimension %d is not direct", i)
20888  *
20889  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
20890  *
20891  * if not slice_is_contig(src, order, ndim):
20892  */
20893  }
20894 
20895  /* "View.MemoryView":1306
20896  * src = tmp
20897  *
20898  * if not broadcasting: # <<<<<<<<<<<<<<
20899  *
20900  *
20901  */
20902  __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
20903  if (__pyx_t_2) {
20904 
20905  /* "View.MemoryView":1309
20906  *
20907  *
20908  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
20909  * direct_copy = slice_is_contig(dst, 'C', ndim)
20910  * elif slice_is_contig(src, 'F', ndim):
20911  */
20912  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
20913  if (__pyx_t_2) {
20914 
20915  /* "View.MemoryView":1310
20916  *
20917  * if slice_is_contig(src, 'C', ndim):
20918  * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
20919  * elif slice_is_contig(src, 'F', ndim):
20920  * direct_copy = slice_is_contig(dst, 'F', ndim)
20921  */
20922  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
20923 
20924  /* "View.MemoryView":1309
20925  *
20926  *
20927  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
20928  * direct_copy = slice_is_contig(dst, 'C', ndim)
20929  * elif slice_is_contig(src, 'F', ndim):
20930  */
20931  goto __pyx_L12;
20932  }
20933 
20934  /* "View.MemoryView":1311
20935  * if slice_is_contig(src, 'C', ndim):
20936  * direct_copy = slice_is_contig(dst, 'C', ndim)
20937  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
20938  * direct_copy = slice_is_contig(dst, 'F', ndim)
20939  *
20940  */
20941  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
20942  if (__pyx_t_2) {
20943 
20944  /* "View.MemoryView":1312
20945  * direct_copy = slice_is_contig(dst, 'C', ndim)
20946  * elif slice_is_contig(src, 'F', ndim):
20947  * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
20948  *
20949  * if direct_copy:
20950  */
20951  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
20952 
20953  /* "View.MemoryView":1311
20954  * if slice_is_contig(src, 'C', ndim):
20955  * direct_copy = slice_is_contig(dst, 'C', ndim)
20956  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
20957  * direct_copy = slice_is_contig(dst, 'F', ndim)
20958  *
20959  */
20960  }
20961  __pyx_L12:;
20962 
20963  /* "View.MemoryView":1314
20964  * direct_copy = slice_is_contig(dst, 'F', ndim)
20965  *
20966  * if direct_copy: # <<<<<<<<<<<<<<
20967  *
20968  * refcount_copying(&dst, dtype_is_object, ndim, False)
20969  */
20970  __pyx_t_2 = (__pyx_v_direct_copy != 0);
20971  if (__pyx_t_2) {
20972 
20973  /* "View.MemoryView":1316
20974  * if direct_copy:
20975  *
20976  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
20977  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
20978  * refcount_copying(&dst, dtype_is_object, ndim, True)
20979  */
20980  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20981 
20982  /* "View.MemoryView":1317
20983  *
20984  * refcount_copying(&dst, dtype_is_object, ndim, False)
20985  * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
20986  * refcount_copying(&dst, dtype_is_object, ndim, True)
20987  * free(tmpdata)
20988  */
20989  (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
20990 
20991  /* "View.MemoryView":1318
20992  * refcount_copying(&dst, dtype_is_object, ndim, False)
20993  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
20994  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
20995  * free(tmpdata)
20996  * return 0
20997  */
20998  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20999 
21000  /* "View.MemoryView":1319
21001  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
21002  * refcount_copying(&dst, dtype_is_object, ndim, True)
21003  * free(tmpdata) # <<<<<<<<<<<<<<
21004  * return 0
21005  *
21006  */
21007  free(__pyx_v_tmpdata);
21008 
21009  /* "View.MemoryView":1320
21010  * refcount_copying(&dst, dtype_is_object, ndim, True)
21011  * free(tmpdata)
21012  * return 0 # <<<<<<<<<<<<<<
21013  *
21014  * if order == 'F' == get_best_order(&dst, ndim):
21015  */
21016  __pyx_r = 0;
21017  goto __pyx_L0;
21018 
21019  /* "View.MemoryView":1314
21020  * direct_copy = slice_is_contig(dst, 'F', ndim)
21021  *
21022  * if direct_copy: # <<<<<<<<<<<<<<
21023  *
21024  * refcount_copying(&dst, dtype_is_object, ndim, False)
21025  */
21026  }
21027 
21028  /* "View.MemoryView":1306
21029  * src = tmp
21030  *
21031  * if not broadcasting: # <<<<<<<<<<<<<<
21032  *
21033  *
21034  */
21035  }
21036 
21037  /* "View.MemoryView":1322
21038  * return 0
21039  *
21040  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
21041  *
21042  *
21043  */
21044  __pyx_t_2 = (__pyx_v_order == 'F');
21045  if (__pyx_t_2) {
21046  __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
21047  }
21048  __pyx_t_8 = (__pyx_t_2 != 0);
21049  if (__pyx_t_8) {
21050 
21051  /* "View.MemoryView":1325
21052  *
21053  *
21054  * transpose_memslice(&src) # <<<<<<<<<<<<<<
21055  * transpose_memslice(&dst)
21056  *
21057  */
21058  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1325, __pyx_L1_error)
21059 
21060  /* "View.MemoryView":1326
21061  *
21062  * transpose_memslice(&src)
21063  * transpose_memslice(&dst) # <<<<<<<<<<<<<<
21064  *
21065  * refcount_copying(&dst, dtype_is_object, ndim, False)
21066  */
21067  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1326, __pyx_L1_error)
21068 
21069  /* "View.MemoryView":1322
21070  * return 0
21071  *
21072  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
21073  *
21074  *
21075  */
21076  }
21077 
21078  /* "View.MemoryView":1328
21079  * transpose_memslice(&dst)
21080  *
21081  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
21082  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
21083  * refcount_copying(&dst, dtype_is_object, ndim, True)
21084  */
21085  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
21086 
21087  /* "View.MemoryView":1329
21088  *
21089  * refcount_copying(&dst, dtype_is_object, ndim, False)
21090  * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
21091  * refcount_copying(&dst, dtype_is_object, ndim, True)
21092  *
21093  */
21094  copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
21095 
21096  /* "View.MemoryView":1330
21097  * refcount_copying(&dst, dtype_is_object, ndim, False)
21098  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
21099  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
21100  *
21101  * free(tmpdata)
21102  */
21103  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
21104 
21105  /* "View.MemoryView":1332
21106  * refcount_copying(&dst, dtype_is_object, ndim, True)
21107  *
21108  * free(tmpdata) # <<<<<<<<<<<<<<
21109  * return 0
21110  *
21111  */
21112  free(__pyx_v_tmpdata);
21113 
21114  /* "View.MemoryView":1333
21115  *
21116  * free(tmpdata)
21117  * return 0 # <<<<<<<<<<<<<<
21118  *
21119  * @cname('__pyx_memoryview_broadcast_leading')
21120  */
21121  __pyx_r = 0;
21122  goto __pyx_L0;
21123 
21124  /* "View.MemoryView":1264
21125  *
21126  * @cname('__pyx_memoryview_copy_contents')
21127  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
21128  * __Pyx_memviewslice dst,
21129  * int src_ndim, int dst_ndim,
21130  */
21131 
21132  /* function exit code */
21133  __pyx_L1_error:;
21134  {
21135  #ifdef WITH_THREAD
21136  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
21137  #endif
21138  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
21139  #ifdef WITH_THREAD
21140  __Pyx_PyGILState_Release(__pyx_gilstate_save);
21141  #endif
21142  }
21143  __pyx_r = -1;
21144  __pyx_L0:;
21145  return __pyx_r;
21146 }
21147 
21148 /* "View.MemoryView":1336
21149  *
21150  * @cname('__pyx_memoryview_broadcast_leading')
21151  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
21152  * int ndim,
21153  * int ndim_other) nogil:
21154  */
21155 
21156 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
21157  int __pyx_v_i;
21158  int __pyx_v_offset;
21159  int __pyx_t_1;
21160  int __pyx_t_2;
21161  int __pyx_t_3;
21162 
21163  /* "View.MemoryView":1340
21164  * int ndim_other) nogil:
21165  * cdef int i
21166  * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
21167  *
21168  * for i in range(ndim - 1, -1, -1):
21169  */
21170  __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
21171 
21172  /* "View.MemoryView":1342
21173  * cdef int offset = ndim_other - ndim
21174  *
21175  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
21176  * mslice.shape[i + offset] = mslice.shape[i]
21177  * mslice.strides[i + offset] = mslice.strides[i]
21178  */
21179  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
21180  __pyx_v_i = __pyx_t_1;
21181 
21182  /* "View.MemoryView":1343
21183  *
21184  * for i in range(ndim - 1, -1, -1):
21185  * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
21186  * mslice.strides[i + offset] = mslice.strides[i]
21187  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
21188  */
21189  (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
21190 
21191  /* "View.MemoryView":1344
21192  * for i in range(ndim - 1, -1, -1):
21193  * mslice.shape[i + offset] = mslice.shape[i]
21194  * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
21195  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
21196  *
21197  */
21198  (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
21199 
21200  /* "View.MemoryView":1345
21201  * mslice.shape[i + offset] = mslice.shape[i]
21202  * mslice.strides[i + offset] = mslice.strides[i]
21203  * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
21204  *
21205  * for i in range(offset):
21206  */
21207  (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
21208  }
21209 
21210  /* "View.MemoryView":1347
21211  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
21212  *
21213  * for i in range(offset): # <<<<<<<<<<<<<<
21214  * mslice.shape[i] = 1
21215  * mslice.strides[i] = mslice.strides[0]
21216  */
21217  __pyx_t_1 = __pyx_v_offset;
21218  __pyx_t_2 = __pyx_t_1;
21219  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
21220  __pyx_v_i = __pyx_t_3;
21221 
21222  /* "View.MemoryView":1348
21223  *
21224  * for i in range(offset):
21225  * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
21226  * mslice.strides[i] = mslice.strides[0]
21227  * mslice.suboffsets[i] = -1
21228  */
21229  (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
21230 
21231  /* "View.MemoryView":1349
21232  * for i in range(offset):
21233  * mslice.shape[i] = 1
21234  * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
21235  * mslice.suboffsets[i] = -1
21236  *
21237  */
21238  (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
21239 
21240  /* "View.MemoryView":1350
21241  * mslice.shape[i] = 1
21242  * mslice.strides[i] = mslice.strides[0]
21243  * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
21244  *
21245  *
21246  */
21247  (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
21248  }
21249 
21250  /* "View.MemoryView":1336
21251  *
21252  * @cname('__pyx_memoryview_broadcast_leading')
21253  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
21254  * int ndim,
21255  * int ndim_other) nogil:
21256  */
21257 
21258  /* function exit code */
21259 }
21260 
21261 /* "View.MemoryView":1358
21262  *
21263  * @cname('__pyx_memoryview_refcount_copying')
21264  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
21265  * int ndim, bint inc) nogil:
21266  *
21267  */
21268 
21269 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
21270  int __pyx_t_1;
21271 
21272  /* "View.MemoryView":1362
21273  *
21274  *
21275  * if dtype_is_object: # <<<<<<<<<<<<<<
21276  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
21277  * dst.strides, ndim, inc)
21278  */
21279  __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
21280  if (__pyx_t_1) {
21281 
21282  /* "View.MemoryView":1363
21283  *
21284  * if dtype_is_object:
21285  * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
21286  * dst.strides, ndim, inc)
21287  *
21288  */
21289  __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
21290 
21291  /* "View.MemoryView":1362
21292  *
21293  *
21294  * if dtype_is_object: # <<<<<<<<<<<<<<
21295  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
21296  * dst.strides, ndim, inc)
21297  */
21298  }
21299 
21300  /* "View.MemoryView":1358
21301  *
21302  * @cname('__pyx_memoryview_refcount_copying')
21303  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
21304  * int ndim, bint inc) nogil:
21305  *
21306  */
21307 
21308  /* function exit code */
21309 }
21310 
21311 /* "View.MemoryView":1367
21312  *
21313  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
21314  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
21315  * Py_ssize_t *strides, int ndim,
21316  * bint inc) with gil:
21317  */
21318 
21319 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
21320  __Pyx_RefNannyDeclarations
21321  #ifdef WITH_THREAD
21322  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
21323  #endif
21324  __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
21325 
21326  /* "View.MemoryView":1370
21327  * Py_ssize_t *strides, int ndim,
21328  * bint inc) with gil:
21329  * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
21330  *
21331  * @cname('__pyx_memoryview_refcount_objects_in_slice')
21332  */
21333  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
21334 
21335  /* "View.MemoryView":1367
21336  *
21337  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
21338  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
21339  * Py_ssize_t *strides, int ndim,
21340  * bint inc) with gil:
21341  */
21342 
21343  /* function exit code */
21344  __Pyx_RefNannyFinishContext();
21345  #ifdef WITH_THREAD
21346  __Pyx_PyGILState_Release(__pyx_gilstate_save);
21347  #endif
21348 }
21349 
21350 /* "View.MemoryView":1373
21351  *
21352  * @cname('__pyx_memoryview_refcount_objects_in_slice')
21353  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
21354  * Py_ssize_t *strides, int ndim, bint inc):
21355  * cdef Py_ssize_t i
21356  */
21357 
21358 static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
21359  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
21360  __Pyx_RefNannyDeclarations
21361  Py_ssize_t __pyx_t_1;
21362  Py_ssize_t __pyx_t_2;
21363  Py_ssize_t __pyx_t_3;
21364  int __pyx_t_4;
21365  __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
21366 
21367  /* "View.MemoryView":1377
21368  * cdef Py_ssize_t i
21369  *
21370  * for i in range(shape[0]): # <<<<<<<<<<<<<<
21371  * if ndim == 1:
21372  * if inc:
21373  */
21374  __pyx_t_1 = (__pyx_v_shape[0]);
21375  __pyx_t_2 = __pyx_t_1;
21376  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
21377  __pyx_v_i = __pyx_t_3;
21378 
21379  /* "View.MemoryView":1378
21380  *
21381  * for i in range(shape[0]):
21382  * if ndim == 1: # <<<<<<<<<<<<<<
21383  * if inc:
21384  * Py_INCREF((<PyObject **> data)[0])
21385  */
21386  __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
21387  if (__pyx_t_4) {
21388 
21389  /* "View.MemoryView":1379
21390  * for i in range(shape[0]):
21391  * if ndim == 1:
21392  * if inc: # <<<<<<<<<<<<<<
21393  * Py_INCREF((<PyObject **> data)[0])
21394  * else:
21395  */
21396  __pyx_t_4 = (__pyx_v_inc != 0);
21397  if (__pyx_t_4) {
21398 
21399  /* "View.MemoryView":1380
21400  * if ndim == 1:
21401  * if inc:
21402  * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
21403  * else:
21404  * Py_DECREF((<PyObject **> data)[0])
21405  */
21406  Py_INCREF((((PyObject **)__pyx_v_data)[0]));
21407 
21408  /* "View.MemoryView":1379
21409  * for i in range(shape[0]):
21410  * if ndim == 1:
21411  * if inc: # <<<<<<<<<<<<<<
21412  * Py_INCREF((<PyObject **> data)[0])
21413  * else:
21414  */
21415  goto __pyx_L6;
21416  }
21417 
21418  /* "View.MemoryView":1382
21419  * Py_INCREF((<PyObject **> data)[0])
21420  * else:
21421  * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
21422  * else:
21423  * refcount_objects_in_slice(data, shape + 1, strides + 1,
21424  */
21425  /*else*/ {
21426  Py_DECREF((((PyObject **)__pyx_v_data)[0]));
21427  }
21428  __pyx_L6:;
21429 
21430  /* "View.MemoryView":1378
21431  *
21432  * for i in range(shape[0]):
21433  * if ndim == 1: # <<<<<<<<<<<<<<
21434  * if inc:
21435  * Py_INCREF((<PyObject **> data)[0])
21436  */
21437  goto __pyx_L5;
21438  }
21439 
21440  /* "View.MemoryView":1384
21441  * Py_DECREF((<PyObject **> data)[0])
21442  * else:
21443  * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
21444  * ndim - 1, inc)
21445  *
21446  */
21447  /*else*/ {
21448 
21449  /* "View.MemoryView":1385
21450  * else:
21451  * refcount_objects_in_slice(data, shape + 1, strides + 1,
21452  * ndim - 1, inc) # <<<<<<<<<<<<<<
21453  *
21454  * data += strides[0]
21455  */
21456  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
21457  }
21458  __pyx_L5:;
21459 
21460  /* "View.MemoryView":1387
21461  * ndim - 1, inc)
21462  *
21463  * data += strides[0] # <<<<<<<<<<<<<<
21464  *
21465  *
21466  */
21467  __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
21468  }
21469 
21470  /* "View.MemoryView":1373
21471  *
21472  * @cname('__pyx_memoryview_refcount_objects_in_slice')
21473  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
21474  * Py_ssize_t *strides, int ndim, bint inc):
21475  * cdef Py_ssize_t i
21476  */
21477 
21478  /* function exit code */
21479  __Pyx_RefNannyFinishContext();
21480 }
21481 
21482 /* "View.MemoryView":1393
21483  *
21484  * @cname('__pyx_memoryview_slice_assign_scalar')
21485  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
21486  * size_t itemsize, void *item,
21487  * bint dtype_is_object) nogil:
21488  */
21489 
21490 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {
21491 
21492  /* "View.MemoryView":1396
21493  * size_t itemsize, void *item,
21494  * bint dtype_is_object) nogil:
21495  * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
21496  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
21497  * itemsize, item)
21498  */
21499  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
21500 
21501  /* "View.MemoryView":1397
21502  * bint dtype_is_object) nogil:
21503  * refcount_copying(dst, dtype_is_object, ndim, False)
21504  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
21505  * itemsize, item)
21506  * refcount_copying(dst, dtype_is_object, ndim, True)
21507  */
21508  __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
21509 
21510  /* "View.MemoryView":1399
21511  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
21512  * itemsize, item)
21513  * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
21514  *
21515  *
21516  */
21517  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
21518 
21519  /* "View.MemoryView":1393
21520  *
21521  * @cname('__pyx_memoryview_slice_assign_scalar')
21522  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
21523  * size_t itemsize, void *item,
21524  * bint dtype_is_object) nogil:
21525  */
21526 
21527  /* function exit code */
21528 }
21529 
21530 /* "View.MemoryView":1403
21531  *
21532  * @cname('__pyx_memoryview__slice_assign_scalar')
21533  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
21534  * Py_ssize_t *strides, int ndim,
21535  * size_t itemsize, void *item) nogil:
21536  */
21537 
21538 static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
21539  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
21540  Py_ssize_t __pyx_v_stride;
21541  Py_ssize_t __pyx_v_extent;
21542  int __pyx_t_1;
21543  Py_ssize_t __pyx_t_2;
21544  Py_ssize_t __pyx_t_3;
21545  Py_ssize_t __pyx_t_4;
21546 
21547  /* "View.MemoryView":1407
21548  * size_t itemsize, void *item) nogil:
21549  * cdef Py_ssize_t i
21550  * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
21551  * cdef Py_ssize_t extent = shape[0]
21552  *
21553  */
21554  __pyx_v_stride = (__pyx_v_strides[0]);
21555 
21556  /* "View.MemoryView":1408
21557  * cdef Py_ssize_t i
21558  * cdef Py_ssize_t stride = strides[0]
21559  * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
21560  *
21561  * if ndim == 1:
21562  */
21563  __pyx_v_extent = (__pyx_v_shape[0]);
21564 
21565  /* "View.MemoryView":1410
21566  * cdef Py_ssize_t extent = shape[0]
21567  *
21568  * if ndim == 1: # <<<<<<<<<<<<<<
21569  * for i in range(extent):
21570  * memcpy(data, item, itemsize)
21571  */
21572  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
21573  if (__pyx_t_1) {
21574 
21575  /* "View.MemoryView":1411
21576  *
21577  * if ndim == 1:
21578  * for i in range(extent): # <<<<<<<<<<<<<<
21579  * memcpy(data, item, itemsize)
21580  * data += stride
21581  */
21582  __pyx_t_2 = __pyx_v_extent;
21583  __pyx_t_3 = __pyx_t_2;
21584  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
21585  __pyx_v_i = __pyx_t_4;
21586 
21587  /* "View.MemoryView":1412
21588  * if ndim == 1:
21589  * for i in range(extent):
21590  * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
21591  * data += stride
21592  * else:
21593  */
21594  (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
21595 
21596  /* "View.MemoryView":1413
21597  * for i in range(extent):
21598  * memcpy(data, item, itemsize)
21599  * data += stride # <<<<<<<<<<<<<<
21600  * else:
21601  * for i in range(extent):
21602  */
21603  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
21604  }
21605 
21606  /* "View.MemoryView":1410
21607  * cdef Py_ssize_t extent = shape[0]
21608  *
21609  * if ndim == 1: # <<<<<<<<<<<<<<
21610  * for i in range(extent):
21611  * memcpy(data, item, itemsize)
21612  */
21613  goto __pyx_L3;
21614  }
21615 
21616  /* "View.MemoryView":1415
21617  * data += stride
21618  * else:
21619  * for i in range(extent): # <<<<<<<<<<<<<<
21620  * _slice_assign_scalar(data, shape + 1, strides + 1,
21621  * ndim - 1, itemsize, item)
21622  */
21623  /*else*/ {
21624  __pyx_t_2 = __pyx_v_extent;
21625  __pyx_t_3 = __pyx_t_2;
21626  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
21627  __pyx_v_i = __pyx_t_4;
21628 
21629  /* "View.MemoryView":1416
21630  * else:
21631  * for i in range(extent):
21632  * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
21633  * ndim - 1, itemsize, item)
21634  * data += stride
21635  */
21636  __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
21637 
21638  /* "View.MemoryView":1418
21639  * _slice_assign_scalar(data, shape + 1, strides + 1,
21640  * ndim - 1, itemsize, item)
21641  * data += stride # <<<<<<<<<<<<<<
21642  *
21643  *
21644  */
21645  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
21646  }
21647  }
21648  __pyx_L3:;
21649 
21650  /* "View.MemoryView":1403
21651  *
21652  * @cname('__pyx_memoryview__slice_assign_scalar')
21653  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
21654  * Py_ssize_t *strides, int ndim,
21655  * size_t itemsize, void *item) nogil:
21656  */
21657 
21658  /* function exit code */
21659 }
21660 
21661 /* "(tree fragment)":1
21662  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
21663  * if __pyx_checksum != 0xb068931:
21664  * from pickle import PickleError as __pyx_PickleError
21665  */
21666 
21667 /* Python wrapper */
21668 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
21669 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
21670 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
21671  PyObject *__pyx_v___pyx_type = 0;
21672  long __pyx_v___pyx_checksum;
21673  PyObject *__pyx_v___pyx_state = 0;
21674  PyObject *__pyx_r = 0;
21675  __Pyx_RefNannyDeclarations
21676  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
21677  {
21678  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
21679  PyObject* values[3] = {0,0,0};
21680  if (unlikely(__pyx_kwds)) {
21681  Py_ssize_t kw_args;
21682  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
21683  switch (pos_args) {
21684  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
21685  CYTHON_FALLTHROUGH;
21686  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
21687  CYTHON_FALLTHROUGH;
21688  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
21689  CYTHON_FALLTHROUGH;
21690  case 0: break;
21691  default: goto __pyx_L5_argtuple_error;
21692  }
21693  kw_args = PyDict_Size(__pyx_kwds);
21694  switch (pos_args) {
21695  case 0:
21696  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
21697  else goto __pyx_L5_argtuple_error;
21698  CYTHON_FALLTHROUGH;
21699  case 1:
21700  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
21701  else {
21702  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
21703  }
21704  CYTHON_FALLTHROUGH;
21705  case 2:
21706  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
21707  else {
21708  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
21709  }
21710  }
21711  if (unlikely(kw_args > 0)) {
21712  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
21713  }
21714  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
21715  goto __pyx_L5_argtuple_error;
21716  } else {
21717  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
21718  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
21719  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
21720  }
21721  __pyx_v___pyx_type = values[0];
21722  __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
21723  __pyx_v___pyx_state = values[2];
21724  }
21725  goto __pyx_L4_argument_unpacking_done;
21726  __pyx_L5_argtuple_error:;
21727  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
21728  __pyx_L3_error:;
21729  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
21730  __Pyx_RefNannyFinishContext();
21731  return NULL;
21732  __pyx_L4_argument_unpacking_done:;
21733  __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
21734 
21735  /* function exit code */
21736  __Pyx_RefNannyFinishContext();
21737  return __pyx_r;
21738 }
21739 
21740 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
21741  PyObject *__pyx_v___pyx_PickleError = NULL;
21742  PyObject *__pyx_v___pyx_result = NULL;
21743  PyObject *__pyx_r = NULL;
21744  __Pyx_RefNannyDeclarations
21745  int __pyx_t_1;
21746  PyObject *__pyx_t_2 = NULL;
21747  PyObject *__pyx_t_3 = NULL;
21748  PyObject *__pyx_t_4 = NULL;
21749  PyObject *__pyx_t_5 = NULL;
21750  PyObject *__pyx_t_6 = NULL;
21751  int __pyx_t_7;
21752  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
21753 
21754  /* "(tree fragment)":2
21755  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):
21756  * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<<
21757  * from pickle import PickleError as __pyx_PickleError
21758  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21759  */
21760  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0);
21761  if (__pyx_t_1) {
21762 
21763  /* "(tree fragment)":3
21764  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):
21765  * if __pyx_checksum != 0xb068931:
21766  * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
21767  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21768  * __pyx_result = Enum.__new__(__pyx_type)
21769  */
21770  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
21771  __Pyx_GOTREF(__pyx_t_2);
21772  __Pyx_INCREF(__pyx_n_s_PickleError);
21773  __Pyx_GIVEREF(__pyx_n_s_PickleError);
21774  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
21775  __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error)
21776  __Pyx_GOTREF(__pyx_t_3);
21777  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21778  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
21779  __Pyx_GOTREF(__pyx_t_2);
21780  __Pyx_INCREF(__pyx_t_2);
21781  __pyx_v___pyx_PickleError = __pyx_t_2;
21782  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21783  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21784 
21785  /* "(tree fragment)":4
21786  * if __pyx_checksum != 0xb068931:
21787  * from pickle import PickleError as __pyx_PickleError
21788  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<<
21789  * __pyx_result = Enum.__new__(__pyx_type)
21790  * if __pyx_state is not None:
21791  */
21792  __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 4, __pyx_L1_error)
21793  __Pyx_GOTREF(__pyx_t_2);
21794  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 4, __pyx_L1_error)
21795  __Pyx_GOTREF(__pyx_t_4);
21796  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21797  __Pyx_INCREF(__pyx_v___pyx_PickleError);
21798  __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
21799  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
21800  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
21801  if (likely(__pyx_t_5)) {
21802  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
21803  __Pyx_INCREF(__pyx_t_5);
21804  __Pyx_INCREF(function);
21805  __Pyx_DECREF_SET(__pyx_t_2, function);
21806  }
21807  }
21808  if (!__pyx_t_5) {
21809  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error)
21810  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21811  __Pyx_GOTREF(__pyx_t_3);
21812  } else {
21813  #if CYTHON_FAST_PYCALL
21814  if (PyFunction_Check(__pyx_t_2)) {
21815  PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
21816  __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error)
21817  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
21818  __Pyx_GOTREF(__pyx_t_3);
21819  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21820  } else
21821  #endif
21822  #if CYTHON_FAST_PYCCALL
21823  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
21824  PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
21825  __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error)
21826  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
21827  __Pyx_GOTREF(__pyx_t_3);
21828  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21829  } else
21830  #endif
21831  {
21832  __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 4, __pyx_L1_error)
21833  __Pyx_GOTREF(__pyx_t_6);
21834  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
21835  __Pyx_GIVEREF(__pyx_t_4);
21836  PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
21837  __pyx_t_4 = 0;
21838  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error)
21839  __Pyx_GOTREF(__pyx_t_3);
21840  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21841  }
21842  }
21843  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21844  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
21845  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21846  __PYX_ERR(1, 4, __pyx_L1_error)
21847 
21848  /* "(tree fragment)":2
21849  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):
21850  * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<<
21851  * from pickle import PickleError as __pyx_PickleError
21852  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21853  */
21854  }
21855 
21856  /* "(tree fragment)":5
21857  * from pickle import PickleError as __pyx_PickleError
21858  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21859  * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
21860  * if __pyx_state is not None:
21861  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21862  */
21863  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
21864  __Pyx_GOTREF(__pyx_t_2);
21865  __pyx_t_6 = NULL;
21866  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
21867  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
21868  if (likely(__pyx_t_6)) {
21869  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
21870  __Pyx_INCREF(__pyx_t_6);
21871  __Pyx_INCREF(function);
21872  __Pyx_DECREF_SET(__pyx_t_2, function);
21873  }
21874  }
21875  if (!__pyx_t_6) {
21876  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
21877  __Pyx_GOTREF(__pyx_t_3);
21878  } else {
21879  #if CYTHON_FAST_PYCALL
21880  if (PyFunction_Check(__pyx_t_2)) {
21881  PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type};
21882  __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
21883  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
21884  __Pyx_GOTREF(__pyx_t_3);
21885  } else
21886  #endif
21887  #if CYTHON_FAST_PYCCALL
21888  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
21889  PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type};
21890  __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
21891  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
21892  __Pyx_GOTREF(__pyx_t_3);
21893  } else
21894  #endif
21895  {
21896  __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
21897  __Pyx_GOTREF(__pyx_t_4);
21898  __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
21899  __Pyx_INCREF(__pyx_v___pyx_type);
21900  __Pyx_GIVEREF(__pyx_v___pyx_type);
21901  PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v___pyx_type);
21902  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
21903  __Pyx_GOTREF(__pyx_t_3);
21904  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21905  }
21906  }
21907  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21908  __pyx_v___pyx_result = __pyx_t_3;
21909  __pyx_t_3 = 0;
21910 
21911  /* "(tree fragment)":6
21912  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21913  * __pyx_result = Enum.__new__(__pyx_type)
21914  * if __pyx_state is not None: # <<<<<<<<<<<<<<
21915  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21916  * return __pyx_result
21917  */
21918  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
21919  __pyx_t_7 = (__pyx_t_1 != 0);
21920  if (__pyx_t_7) {
21921 
21922  /* "(tree fragment)":7
21923  * __pyx_result = Enum.__new__(__pyx_type)
21924  * if __pyx_state is not None:
21925  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
21926  * return __pyx_result
21927  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21928  */
21929  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 7, __pyx_L1_error)
21930  __pyx_t_3 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
21931  __Pyx_GOTREF(__pyx_t_3);
21932  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21933 
21934  /* "(tree fragment)":6
21935  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21936  * __pyx_result = Enum.__new__(__pyx_type)
21937  * if __pyx_state is not None: # <<<<<<<<<<<<<<
21938  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21939  * return __pyx_result
21940  */
21941  }
21942 
21943  /* "(tree fragment)":8
21944  * if __pyx_state is not None:
21945  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21946  * return __pyx_result # <<<<<<<<<<<<<<
21947  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21948  * __pyx_result.name = __pyx_state[0]
21949  */
21950  __Pyx_XDECREF(__pyx_r);
21951  __Pyx_INCREF(__pyx_v___pyx_result);
21952  __pyx_r = __pyx_v___pyx_result;
21953  goto __pyx_L0;
21954 
21955  /* "(tree fragment)":1
21956  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
21957  * if __pyx_checksum != 0xb068931:
21958  * from pickle import PickleError as __pyx_PickleError
21959  */
21960 
21961  /* function exit code */
21962  __pyx_L1_error:;
21963  __Pyx_XDECREF(__pyx_t_2);
21964  __Pyx_XDECREF(__pyx_t_3);
21965  __Pyx_XDECREF(__pyx_t_4);
21966  __Pyx_XDECREF(__pyx_t_5);
21967  __Pyx_XDECREF(__pyx_t_6);
21968  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
21969  __pyx_r = NULL;
21970  __pyx_L0:;
21971  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
21972  __Pyx_XDECREF(__pyx_v___pyx_result);
21973  __Pyx_XGIVEREF(__pyx_r);
21974  __Pyx_RefNannyFinishContext();
21975  return __pyx_r;
21976 }
21977 
21978 /* "(tree fragment)":9
21979  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21980  * return __pyx_result
21981  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
21982  * __pyx_result.name = __pyx_state[0]
21983  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21984  */
21985 
21986 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
21987  PyObject *__pyx_r = NULL;
21988  __Pyx_RefNannyDeclarations
21989  PyObject *__pyx_t_1 = NULL;
21990  int __pyx_t_2;
21991  Py_ssize_t __pyx_t_3;
21992  int __pyx_t_4;
21993  int __pyx_t_5;
21994  PyObject *__pyx_t_6 = NULL;
21995  PyObject *__pyx_t_7 = NULL;
21996  PyObject *__pyx_t_8 = NULL;
21997  PyObject *__pyx_t_9 = NULL;
21998  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
21999 
22000  /* "(tree fragment)":10
22001  * return __pyx_result
22002  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
22003  * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<<
22004  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
22005  * __pyx_result.__dict__.update(__pyx_state[1])
22006  */
22007  if (unlikely(__pyx_v___pyx_state == Py_None)) {
22008  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
22009  __PYX_ERR(1, 10, __pyx_L1_error)
22010  }
22011  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error)
22012  __Pyx_GOTREF(__pyx_t_1);
22013  __Pyx_GIVEREF(__pyx_t_1);
22014  __Pyx_GOTREF(__pyx_v___pyx_result->name);
22015  __Pyx_DECREF(__pyx_v___pyx_result->name);
22016  __pyx_v___pyx_result->name = __pyx_t_1;
22017  __pyx_t_1 = 0;
22018 
22019  /* "(tree fragment)":11
22020  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
22021  * __pyx_result.name = __pyx_state[0]
22022  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
22023  * __pyx_result.__dict__.update(__pyx_state[1])
22024  */
22025  if (unlikely(__pyx_v___pyx_state == Py_None)) {
22026  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
22027  __PYX_ERR(1, 11, __pyx_L1_error)
22028  }
22029  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 11, __pyx_L1_error)
22030  __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
22031  if (__pyx_t_4) {
22032  } else {
22033  __pyx_t_2 = __pyx_t_4;
22034  goto __pyx_L4_bool_binop_done;
22035  }
22036  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 11, __pyx_L1_error)
22037  __pyx_t_5 = (__pyx_t_4 != 0);
22038  __pyx_t_2 = __pyx_t_5;
22039  __pyx_L4_bool_binop_done:;
22040  if (__pyx_t_2) {
22041 
22042  /* "(tree fragment)":12
22043  * __pyx_result.name = __pyx_state[0]
22044  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
22045  * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
22046  */
22047  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 12, __pyx_L1_error)
22048  __Pyx_GOTREF(__pyx_t_6);
22049  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 12, __pyx_L1_error)
22050  __Pyx_GOTREF(__pyx_t_7);
22051  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22052  if (unlikely(__pyx_v___pyx_state == Py_None)) {
22053  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
22054  __PYX_ERR(1, 12, __pyx_L1_error)
22055  }
22056  __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 12, __pyx_L1_error)
22057  __Pyx_GOTREF(__pyx_t_6);
22058  __pyx_t_8 = NULL;
22059  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
22060  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
22061  if (likely(__pyx_t_8)) {
22062  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
22063  __Pyx_INCREF(__pyx_t_8);
22064  __Pyx_INCREF(function);
22065  __Pyx_DECREF_SET(__pyx_t_7, function);
22066  }
22067  }
22068  if (!__pyx_t_8) {
22069  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
22070  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22071  __Pyx_GOTREF(__pyx_t_1);
22072  } else {
22073  #if CYTHON_FAST_PYCALL
22074  if (PyFunction_Check(__pyx_t_7)) {
22075  PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_6};
22076  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
22077  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
22078  __Pyx_GOTREF(__pyx_t_1);
22079  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22080  } else
22081  #endif
22082  #if CYTHON_FAST_PYCCALL
22083  if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
22084  PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_6};
22085  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
22086  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
22087  __Pyx_GOTREF(__pyx_t_1);
22088  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22089  } else
22090  #endif
22091  {
22092  __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 12, __pyx_L1_error)
22093  __Pyx_GOTREF(__pyx_t_9);
22094  __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
22095  __Pyx_GIVEREF(__pyx_t_6);
22096  PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_6);
22097  __pyx_t_6 = 0;
22098  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
22099  __Pyx_GOTREF(__pyx_t_1);
22100  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
22101  }
22102  }
22103  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22104  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22105 
22106  /* "(tree fragment)":11
22107  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
22108  * __pyx_result.name = __pyx_state[0]
22109  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
22110  * __pyx_result.__dict__.update(__pyx_state[1])
22111  */
22112  }
22113 
22114  /* "(tree fragment)":9
22115  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
22116  * return __pyx_result
22117  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
22118  * __pyx_result.name = __pyx_state[0]
22119  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
22120  */
22121 
22122  /* function exit code */
22123  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
22124  goto __pyx_L0;
22125  __pyx_L1_error:;
22126  __Pyx_XDECREF(__pyx_t_1);
22127  __Pyx_XDECREF(__pyx_t_6);
22128  __Pyx_XDECREF(__pyx_t_7);
22129  __Pyx_XDECREF(__pyx_t_8);
22130  __Pyx_XDECREF(__pyx_t_9);
22131  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
22132  __pyx_r = 0;
22133  __pyx_L0:;
22134  __Pyx_XGIVEREF(__pyx_r);
22135  __Pyx_RefNannyFinishContext();
22136  return __pyx_r;
22137 }
22138 
22139 static PyObject *__pyx_tp_new_10csmoothers_cASMFactor(PyTypeObject *t, PyObject *a, PyObject *k) {
22140  PyObject *o;
22141  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22142  o = (*t->tp_alloc)(t, 0);
22143  } else {
22144  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22145  }
22146  if (unlikely(!o)) return 0;
22147  if (unlikely(__pyx_pw_10csmoothers_10cASMFactor_1__cinit__(o, a, k) < 0)) goto bad;
22148  return o;
22149  bad:
22150  Py_DECREF(o); o = 0;
22151  return NULL;
22152 }
22153 
22154 static void __pyx_tp_dealloc_10csmoothers_cASMFactor(PyObject *o) {
22155  #if CYTHON_USE_TP_FINALIZE
22156  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
22157  if (PyObject_CallFinalizerFromDealloc(o)) return;
22158  }
22159  #endif
22160  {
22161  PyObject *etype, *eval, *etb;
22162  PyErr_Fetch(&etype, &eval, &etb);
22163  ++Py_REFCNT(o);
22164  __pyx_pw_10csmoothers_10cASMFactor_3__dealloc__(o);
22165  --Py_REFCNT(o);
22166  PyErr_Restore(etype, eval, etb);
22167  }
22168  (*Py_TYPE(o)->tp_free)(o);
22169 }
22170 
22171 static PyMethodDef __pyx_methods_10csmoothers_cASMFactor[] = {
22172  {"__reduce_cython__", (PyCFunction)__pyx_pw_10csmoothers_10cASMFactor_5__reduce_cython__, METH_NOARGS, 0},
22173  {"__setstate_cython__", (PyCFunction)__pyx_pw_10csmoothers_10cASMFactor_7__setstate_cython__, METH_O, 0},
22174  {0, 0, 0, 0}
22175 };
22176 
22177 static PyTypeObject __pyx_type_10csmoothers_cASMFactor = {
22178  PyVarObject_HEAD_INIT(0, 0)
22179  "csmoothers.cASMFactor", /*tp_name*/
22180  sizeof(struct __pyx_obj_10csmoothers_cASMFactor), /*tp_basicsize*/
22181  0, /*tp_itemsize*/
22182  __pyx_tp_dealloc_10csmoothers_cASMFactor, /*tp_dealloc*/
22183  0, /*tp_print*/
22184  0, /*tp_getattr*/
22185  0, /*tp_setattr*/
22186  #if PY_MAJOR_VERSION < 3
22187  0, /*tp_compare*/
22188  #endif
22189  #if PY_MAJOR_VERSION >= 3
22190  0, /*tp_as_async*/
22191  #endif
22192  0, /*tp_repr*/
22193  0, /*tp_as_number*/
22194  0, /*tp_as_sequence*/
22195  0, /*tp_as_mapping*/
22196  0, /*tp_hash*/
22197  0, /*tp_call*/
22198  0, /*tp_str*/
22199  0, /*tp_getattro*/
22200  0, /*tp_setattro*/
22201  0, /*tp_as_buffer*/
22202  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
22203  0, /*tp_doc*/
22204  0, /*tp_traverse*/
22205  0, /*tp_clear*/
22206  0, /*tp_richcompare*/
22207  0, /*tp_weaklistoffset*/
22208  0, /*tp_iter*/
22209  0, /*tp_iternext*/
22210  __pyx_methods_10csmoothers_cASMFactor, /*tp_methods*/
22211  0, /*tp_members*/
22212  0, /*tp_getset*/
22213  0, /*tp_base*/
22214  0, /*tp_dict*/
22215  0, /*tp_descr_get*/
22216  0, /*tp_descr_set*/
22217  0, /*tp_dictoffset*/
22218  0, /*tp_init*/
22219  0, /*tp_alloc*/
22220  __pyx_tp_new_10csmoothers_cASMFactor, /*tp_new*/
22221  0, /*tp_free*/
22222  0, /*tp_is_gc*/
22223  0, /*tp_bases*/
22224  0, /*tp_mro*/
22225  0, /*tp_cache*/
22226  0, /*tp_subclasses*/
22227  0, /*tp_weaklist*/
22228  0, /*tp_del*/
22229  0, /*tp_version_tag*/
22230  #if PY_VERSION_HEX >= 0x030400a1
22231  0, /*tp_finalize*/
22232  #endif
22233 };
22234 
22235 static PyObject *__pyx_tp_new_10csmoothers_cBASMFactor(PyTypeObject *t, PyObject *a, PyObject *k) {
22236  PyObject *o;
22237  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22238  o = (*t->tp_alloc)(t, 0);
22239  } else {
22240  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22241  }
22242  if (unlikely(!o)) return 0;
22243  if (unlikely(__pyx_pw_10csmoothers_11cBASMFactor_1__cinit__(o, a, k) < 0)) goto bad;
22244  return o;
22245  bad:
22246  Py_DECREF(o); o = 0;
22247  return NULL;
22248 }
22249 
22250 static void __pyx_tp_dealloc_10csmoothers_cBASMFactor(PyObject *o) {
22251  #if CYTHON_USE_TP_FINALIZE
22252  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
22253  if (PyObject_CallFinalizerFromDealloc(o)) return;
22254  }
22255  #endif
22256  {
22257  PyObject *etype, *eval, *etb;
22258  PyErr_Fetch(&etype, &eval, &etb);
22259  ++Py_REFCNT(o);
22260  __pyx_pw_10csmoothers_11cBASMFactor_3__dealloc__(o);
22261  --Py_REFCNT(o);
22262  PyErr_Restore(etype, eval, etb);
22263  }
22264  (*Py_TYPE(o)->tp_free)(o);
22265 }
22266 
22267 static PyMethodDef __pyx_methods_10csmoothers_cBASMFactor[] = {
22268  {"__reduce_cython__", (PyCFunction)__pyx_pw_10csmoothers_11cBASMFactor_5__reduce_cython__, METH_NOARGS, 0},
22269  {"__setstate_cython__", (PyCFunction)__pyx_pw_10csmoothers_11cBASMFactor_7__setstate_cython__, METH_O, 0},
22270  {0, 0, 0, 0}
22271 };
22272 
22273 static PyTypeObject __pyx_type_10csmoothers_cBASMFactor = {
22274  PyVarObject_HEAD_INIT(0, 0)
22275  "csmoothers.cBASMFactor", /*tp_name*/
22276  sizeof(struct __pyx_obj_10csmoothers_cBASMFactor), /*tp_basicsize*/
22277  0, /*tp_itemsize*/
22278  __pyx_tp_dealloc_10csmoothers_cBASMFactor, /*tp_dealloc*/
22279  0, /*tp_print*/
22280  0, /*tp_getattr*/
22281  0, /*tp_setattr*/
22282  #if PY_MAJOR_VERSION < 3
22283  0, /*tp_compare*/
22284  #endif
22285  #if PY_MAJOR_VERSION >= 3
22286  0, /*tp_as_async*/
22287  #endif
22288  0, /*tp_repr*/
22289  0, /*tp_as_number*/
22290  0, /*tp_as_sequence*/
22291  0, /*tp_as_mapping*/
22292  0, /*tp_hash*/
22293  0, /*tp_call*/
22294  0, /*tp_str*/
22295  0, /*tp_getattro*/
22296  0, /*tp_setattro*/
22297  0, /*tp_as_buffer*/
22298  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
22299  0, /*tp_doc*/
22300  0, /*tp_traverse*/
22301  0, /*tp_clear*/
22302  0, /*tp_richcompare*/
22303  0, /*tp_weaklistoffset*/
22304  0, /*tp_iter*/
22305  0, /*tp_iternext*/
22306  __pyx_methods_10csmoothers_cBASMFactor, /*tp_methods*/
22307  0, /*tp_members*/
22308  0, /*tp_getset*/
22309  0, /*tp_base*/
22310  0, /*tp_dict*/
22311  0, /*tp_descr_get*/
22312  0, /*tp_descr_set*/
22313  0, /*tp_dictoffset*/
22314  0, /*tp_init*/
22315  0, /*tp_alloc*/
22316  __pyx_tp_new_10csmoothers_cBASMFactor, /*tp_new*/
22317  0, /*tp_free*/
22318  0, /*tp_is_gc*/
22319  0, /*tp_bases*/
22320  0, /*tp_mro*/
22321  0, /*tp_cache*/
22322  0, /*tp_subclasses*/
22323  0, /*tp_weaklist*/
22324  0, /*tp_del*/
22325  0, /*tp_version_tag*/
22326  #if PY_VERSION_HEX >= 0x030400a1
22327  0, /*tp_finalize*/
22328  #endif
22329 };
22330 static struct __pyx_vtabstruct_array __pyx_vtable_array;
22331 
22332 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
22333  struct __pyx_array_obj *p;
22334  PyObject *o;
22335  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22336  o = (*t->tp_alloc)(t, 0);
22337  } else {
22338  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22339  }
22340  if (unlikely(!o)) return 0;
22341  p = ((struct __pyx_array_obj *)o);
22342  p->__pyx_vtab = __pyx_vtabptr_array;
22343  p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
22344  p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
22345  if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
22346  return o;
22347  bad:
22348  Py_DECREF(o); o = 0;
22349  return NULL;
22350 }
22351 
22352 static void __pyx_tp_dealloc_array(PyObject *o) {
22353  struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
22354  #if CYTHON_USE_TP_FINALIZE
22355  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
22356  if (PyObject_CallFinalizerFromDealloc(o)) return;
22357  }
22358  #endif
22359  {
22360  PyObject *etype, *eval, *etb;
22361  PyErr_Fetch(&etype, &eval, &etb);
22362  ++Py_REFCNT(o);
22363  __pyx_array___dealloc__(o);
22364  --Py_REFCNT(o);
22365  PyErr_Restore(etype, eval, etb);
22366  }
22367  Py_CLEAR(p->mode);
22368  Py_CLEAR(p->_format);
22369  (*Py_TYPE(o)->tp_free)(o);
22370 }
22371 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
22372  PyObject *r;
22373  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
22374  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
22375  Py_DECREF(x);
22376  return r;
22377 }
22378 
22379 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
22380  if (v) {
22381  return __pyx_array___setitem__(o, i, v);
22382  }
22383  else {
22384  PyErr_Format(PyExc_NotImplementedError,
22385  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
22386  return -1;
22387  }
22388 }
22389 
22390 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
22391  PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
22392  if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
22393  PyErr_Clear();
22394  v = __pyx_array___getattr__(o, n);
22395  }
22396  return v;
22397 }
22398 
22399 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
22400  return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
22401 }
22402 
22403 static PyMethodDef __pyx_methods_array[] = {
22404  {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
22405  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
22406  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
22407  {0, 0, 0, 0}
22408 };
22409 
22410 static struct PyGetSetDef __pyx_getsets_array[] = {
22411  {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
22412  {0, 0, 0, 0, 0}
22413 };
22414 
22415 static PySequenceMethods __pyx_tp_as_sequence_array = {
22416  __pyx_array___len__, /*sq_length*/
22417  0, /*sq_concat*/
22418  0, /*sq_repeat*/
22419  __pyx_sq_item_array, /*sq_item*/
22420  0, /*sq_slice*/
22421  0, /*sq_ass_item*/
22422  0, /*sq_ass_slice*/
22423  0, /*sq_contains*/
22424  0, /*sq_inplace_concat*/
22425  0, /*sq_inplace_repeat*/
22426 };
22427 
22428 static PyMappingMethods __pyx_tp_as_mapping_array = {
22429  __pyx_array___len__, /*mp_length*/
22430  __pyx_array___getitem__, /*mp_subscript*/
22431  __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
22432 };
22433 
22434 static PyBufferProcs __pyx_tp_as_buffer_array = {
22435  #if PY_MAJOR_VERSION < 3
22436  0, /*bf_getreadbuffer*/
22437  #endif
22438  #if PY_MAJOR_VERSION < 3
22439  0, /*bf_getwritebuffer*/
22440  #endif
22441  #if PY_MAJOR_VERSION < 3
22442  0, /*bf_getsegcount*/
22443  #endif
22444  #if PY_MAJOR_VERSION < 3
22445  0, /*bf_getcharbuffer*/
22446  #endif
22447  __pyx_array_getbuffer, /*bf_getbuffer*/
22448  0, /*bf_releasebuffer*/
22449 };
22450 
22451 static PyTypeObject __pyx_type___pyx_array = {
22452  PyVarObject_HEAD_INIT(0, 0)
22453  "csmoothers.array", /*tp_name*/
22454  sizeof(struct __pyx_array_obj), /*tp_basicsize*/
22455  0, /*tp_itemsize*/
22456  __pyx_tp_dealloc_array, /*tp_dealloc*/
22457  0, /*tp_print*/
22458  0, /*tp_getattr*/
22459  0, /*tp_setattr*/
22460  #if PY_MAJOR_VERSION < 3
22461  0, /*tp_compare*/
22462  #endif
22463  #if PY_MAJOR_VERSION >= 3
22464  0, /*tp_as_async*/
22465  #endif
22466  0, /*tp_repr*/
22467  0, /*tp_as_number*/
22468  &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
22469  &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
22470  0, /*tp_hash*/
22471  0, /*tp_call*/
22472  0, /*tp_str*/
22473  __pyx_tp_getattro_array, /*tp_getattro*/
22474  0, /*tp_setattro*/
22475  &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
22476  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
22477  0, /*tp_doc*/
22478  0, /*tp_traverse*/
22479  0, /*tp_clear*/
22480  0, /*tp_richcompare*/
22481  0, /*tp_weaklistoffset*/
22482  0, /*tp_iter*/
22483  0, /*tp_iternext*/
22484  __pyx_methods_array, /*tp_methods*/
22485  0, /*tp_members*/
22486  __pyx_getsets_array, /*tp_getset*/
22487  0, /*tp_base*/
22488  0, /*tp_dict*/
22489  0, /*tp_descr_get*/
22490  0, /*tp_descr_set*/
22491  0, /*tp_dictoffset*/
22492  0, /*tp_init*/
22493  0, /*tp_alloc*/
22494  __pyx_tp_new_array, /*tp_new*/
22495  0, /*tp_free*/
22496  0, /*tp_is_gc*/
22497  0, /*tp_bases*/
22498  0, /*tp_mro*/
22499  0, /*tp_cache*/
22500  0, /*tp_subclasses*/
22501  0, /*tp_weaklist*/
22502  0, /*tp_del*/
22503  0, /*tp_version_tag*/
22504  #if PY_VERSION_HEX >= 0x030400a1
22505  0, /*tp_finalize*/
22506  #endif
22507 };
22508 
22509 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
22510  struct __pyx_MemviewEnum_obj *p;
22511  PyObject *o;
22512  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22513  o = (*t->tp_alloc)(t, 0);
22514  } else {
22515  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22516  }
22517  if (unlikely(!o)) return 0;
22518  p = ((struct __pyx_MemviewEnum_obj *)o);
22519  p->name = Py_None; Py_INCREF(Py_None);
22520  return o;
22521 }
22522 
22523 static void __pyx_tp_dealloc_Enum(PyObject *o) {
22524  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
22525  #if CYTHON_USE_TP_FINALIZE
22526  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22527  if (PyObject_CallFinalizerFromDealloc(o)) return;
22528  }
22529  #endif
22530  PyObject_GC_UnTrack(o);
22531  Py_CLEAR(p->name);
22532  (*Py_TYPE(o)->tp_free)(o);
22533 }
22534 
22535 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
22536  int e;
22537  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
22538  if (p->name) {
22539  e = (*v)(p->name, a); if (e) return e;
22540  }
22541  return 0;
22542 }
22543 
22544 static int __pyx_tp_clear_Enum(PyObject *o) {
22545  PyObject* tmp;
22546  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
22547  tmp = ((PyObject*)p->name);
22548  p->name = Py_None; Py_INCREF(Py_None);
22549  Py_XDECREF(tmp);
22550  return 0;
22551 }
22552 
22553 static PyMethodDef __pyx_methods_Enum[] = {
22554  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
22555  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
22556  {0, 0, 0, 0}
22557 };
22558 
22559 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
22560  PyVarObject_HEAD_INIT(0, 0)
22561  "csmoothers.Enum", /*tp_name*/
22562  sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
22563  0, /*tp_itemsize*/
22564  __pyx_tp_dealloc_Enum, /*tp_dealloc*/
22565  0, /*tp_print*/
22566  0, /*tp_getattr*/
22567  0, /*tp_setattr*/
22568  #if PY_MAJOR_VERSION < 3
22569  0, /*tp_compare*/
22570  #endif
22571  #if PY_MAJOR_VERSION >= 3
22572  0, /*tp_as_async*/
22573  #endif
22574  __pyx_MemviewEnum___repr__, /*tp_repr*/
22575  0, /*tp_as_number*/
22576  0, /*tp_as_sequence*/
22577  0, /*tp_as_mapping*/
22578  0, /*tp_hash*/
22579  0, /*tp_call*/
22580  0, /*tp_str*/
22581  0, /*tp_getattro*/
22582  0, /*tp_setattro*/
22583  0, /*tp_as_buffer*/
22584  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
22585  0, /*tp_doc*/
22586  __pyx_tp_traverse_Enum, /*tp_traverse*/
22587  __pyx_tp_clear_Enum, /*tp_clear*/
22588  0, /*tp_richcompare*/
22589  0, /*tp_weaklistoffset*/
22590  0, /*tp_iter*/
22591  0, /*tp_iternext*/
22592  __pyx_methods_Enum, /*tp_methods*/
22593  0, /*tp_members*/
22594  0, /*tp_getset*/
22595  0, /*tp_base*/
22596  0, /*tp_dict*/
22597  0, /*tp_descr_get*/
22598  0, /*tp_descr_set*/
22599  0, /*tp_dictoffset*/
22600  __pyx_MemviewEnum___init__, /*tp_init*/
22601  0, /*tp_alloc*/
22602  __pyx_tp_new_Enum, /*tp_new*/
22603  0, /*tp_free*/
22604  0, /*tp_is_gc*/
22605  0, /*tp_bases*/
22606  0, /*tp_mro*/
22607  0, /*tp_cache*/
22608  0, /*tp_subclasses*/
22609  0, /*tp_weaklist*/
22610  0, /*tp_del*/
22611  0, /*tp_version_tag*/
22612  #if PY_VERSION_HEX >= 0x030400a1
22613  0, /*tp_finalize*/
22614  #endif
22615 };
22616 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
22617 
22618 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
22619  struct __pyx_memoryview_obj *p;
22620  PyObject *o;
22621  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22622  o = (*t->tp_alloc)(t, 0);
22623  } else {
22624  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22625  }
22626  if (unlikely(!o)) return 0;
22627  p = ((struct __pyx_memoryview_obj *)o);
22628  p->__pyx_vtab = __pyx_vtabptr_memoryview;
22629  p->obj = Py_None; Py_INCREF(Py_None);
22630  p->_size = Py_None; Py_INCREF(Py_None);
22631  p->_array_interface = Py_None; Py_INCREF(Py_None);
22632  p->view.obj = NULL;
22633  if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
22634  return o;
22635  bad:
22636  Py_DECREF(o); o = 0;
22637  return NULL;
22638 }
22639 
22640 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
22641  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
22642  #if CYTHON_USE_TP_FINALIZE
22643  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22644  if (PyObject_CallFinalizerFromDealloc(o)) return;
22645  }
22646  #endif
22647  PyObject_GC_UnTrack(o);
22648  {
22649  PyObject *etype, *eval, *etb;
22650  PyErr_Fetch(&etype, &eval, &etb);
22651  ++Py_REFCNT(o);
22652  __pyx_memoryview___dealloc__(o);
22653  --Py_REFCNT(o);
22654  PyErr_Restore(etype, eval, etb);
22655  }
22656  Py_CLEAR(p->obj);
22657  Py_CLEAR(p->_size);
22658  Py_CLEAR(p->_array_interface);
22659  (*Py_TYPE(o)->tp_free)(o);
22660 }
22661 
22662 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
22663  int e;
22664  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
22665  if (p->obj) {
22666  e = (*v)(p->obj, a); if (e) return e;
22667  }
22668  if (p->_size) {
22669  e = (*v)(p->_size, a); if (e) return e;
22670  }
22671  if (p->_array_interface) {
22672  e = (*v)(p->_array_interface, a); if (e) return e;
22673  }
22674  if (p->view.obj) {
22675  e = (*v)(p->view.obj, a); if (e) return e;
22676  }
22677  return 0;
22678 }
22679 
22680 static int __pyx_tp_clear_memoryview(PyObject *o) {
22681  PyObject* tmp;
22682  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
22683  tmp = ((PyObject*)p->obj);
22684  p->obj = Py_None; Py_INCREF(Py_None);
22685  Py_XDECREF(tmp);
22686  tmp = ((PyObject*)p->_size);
22687  p->_size = Py_None; Py_INCREF(Py_None);
22688  Py_XDECREF(tmp);
22689  tmp = ((PyObject*)p->_array_interface);
22690  p->_array_interface = Py_None; Py_INCREF(Py_None);
22691  Py_XDECREF(tmp);
22692  Py_CLEAR(p->view.obj);
22693  return 0;
22694 }
22695 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
22696  PyObject *r;
22697  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
22698  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
22699  Py_DECREF(x);
22700  return r;
22701 }
22702 
22703 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
22704  if (v) {
22705  return __pyx_memoryview___setitem__(o, i, v);
22706  }
22707  else {
22708  PyErr_Format(PyExc_NotImplementedError,
22709  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
22710  return -1;
22711  }
22712 }
22713 
22714 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
22715  return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
22716 }
22717 
22718 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
22719  return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
22720 }
22721 
22722 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
22723  return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
22724 }
22725 
22726 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
22727  return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
22728 }
22729 
22730 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
22731  return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
22732 }
22733 
22734 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
22735  return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
22736 }
22737 
22738 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
22739  return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
22740 }
22741 
22742 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
22743  return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
22744 }
22745 
22746 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
22747  return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
22748 }
22749 
22750 static PyMethodDef __pyx_methods_memoryview[] = {
22751  {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
22752  {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
22753  {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
22754  {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
22755  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
22756  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
22757  {0, 0, 0, 0}
22758 };
22759 
22760 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
22761  {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
22762  {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
22763  {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
22764  {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
22765  {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
22766  {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
22767  {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
22768  {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
22769  {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
22770  {0, 0, 0, 0, 0}
22771 };
22772 
22773 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
22774  __pyx_memoryview___len__, /*sq_length*/
22775  0, /*sq_concat*/
22776  0, /*sq_repeat*/
22777  __pyx_sq_item_memoryview, /*sq_item*/
22778  0, /*sq_slice*/
22779  0, /*sq_ass_item*/
22780  0, /*sq_ass_slice*/
22781  0, /*sq_contains*/
22782  0, /*sq_inplace_concat*/
22783  0, /*sq_inplace_repeat*/
22784 };
22785 
22786 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
22787  __pyx_memoryview___len__, /*mp_length*/
22788  __pyx_memoryview___getitem__, /*mp_subscript*/
22789  __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
22790 };
22791 
22792 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
22793  #if PY_MAJOR_VERSION < 3
22794  0, /*bf_getreadbuffer*/
22795  #endif
22796  #if PY_MAJOR_VERSION < 3
22797  0, /*bf_getwritebuffer*/
22798  #endif
22799  #if PY_MAJOR_VERSION < 3
22800  0, /*bf_getsegcount*/
22801  #endif
22802  #if PY_MAJOR_VERSION < 3
22803  0, /*bf_getcharbuffer*/
22804  #endif
22805  __pyx_memoryview_getbuffer, /*bf_getbuffer*/
22806  0, /*bf_releasebuffer*/
22807 };
22808 
22809 static PyTypeObject __pyx_type___pyx_memoryview = {
22810  PyVarObject_HEAD_INIT(0, 0)
22811  "csmoothers.memoryview", /*tp_name*/
22812  sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
22813  0, /*tp_itemsize*/
22814  __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
22815  0, /*tp_print*/
22816  0, /*tp_getattr*/
22817  0, /*tp_setattr*/
22818  #if PY_MAJOR_VERSION < 3
22819  0, /*tp_compare*/
22820  #endif
22821  #if PY_MAJOR_VERSION >= 3
22822  0, /*tp_as_async*/
22823  #endif
22824  __pyx_memoryview___repr__, /*tp_repr*/
22825  0, /*tp_as_number*/
22826  &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
22827  &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
22828  0, /*tp_hash*/
22829  0, /*tp_call*/
22830  __pyx_memoryview___str__, /*tp_str*/
22831  0, /*tp_getattro*/
22832  0, /*tp_setattro*/
22833  &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
22834  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
22835  0, /*tp_doc*/
22836  __pyx_tp_traverse_memoryview, /*tp_traverse*/
22837  __pyx_tp_clear_memoryview, /*tp_clear*/
22838  0, /*tp_richcompare*/
22839  0, /*tp_weaklistoffset*/
22840  0, /*tp_iter*/
22841  0, /*tp_iternext*/
22842  __pyx_methods_memoryview, /*tp_methods*/
22843  0, /*tp_members*/
22844  __pyx_getsets_memoryview, /*tp_getset*/
22845  0, /*tp_base*/
22846  0, /*tp_dict*/
22847  0, /*tp_descr_get*/
22848  0, /*tp_descr_set*/
22849  0, /*tp_dictoffset*/
22850  0, /*tp_init*/
22851  0, /*tp_alloc*/
22852  __pyx_tp_new_memoryview, /*tp_new*/
22853  0, /*tp_free*/
22854  0, /*tp_is_gc*/
22855  0, /*tp_bases*/
22856  0, /*tp_mro*/
22857  0, /*tp_cache*/
22858  0, /*tp_subclasses*/
22859  0, /*tp_weaklist*/
22860  0, /*tp_del*/
22861  0, /*tp_version_tag*/
22862  #if PY_VERSION_HEX >= 0x030400a1
22863  0, /*tp_finalize*/
22864  #endif
22865 };
22866 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
22867 
22868 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
22869  struct __pyx_memoryviewslice_obj *p;
22870  PyObject *o = __pyx_tp_new_memoryview(t, a, k);
22871  if (unlikely(!o)) return 0;
22872  p = ((struct __pyx_memoryviewslice_obj *)o);
22873  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
22874  p->from_object = Py_None; Py_INCREF(Py_None);
22875  p->from_slice.memview = NULL;
22876  return o;
22877 }
22878 
22879 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
22880  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
22881  #if CYTHON_USE_TP_FINALIZE
22882  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22883  if (PyObject_CallFinalizerFromDealloc(o)) return;
22884  }
22885  #endif
22886  PyObject_GC_UnTrack(o);
22887  {
22888  PyObject *etype, *eval, *etb;
22889  PyErr_Fetch(&etype, &eval, &etb);
22890  ++Py_REFCNT(o);
22891  __pyx_memoryviewslice___dealloc__(o);
22892  --Py_REFCNT(o);
22893  PyErr_Restore(etype, eval, etb);
22894  }
22895  Py_CLEAR(p->from_object);
22896  PyObject_GC_Track(o);
22897  __pyx_tp_dealloc_memoryview(o);
22898 }
22899 
22900 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
22901  int e;
22902  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
22903  e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
22904  if (p->from_object) {
22905  e = (*v)(p->from_object, a); if (e) return e;
22906  }
22907  return 0;
22908 }
22909 
22910 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
22911  PyObject* tmp;
22912  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
22913  __pyx_tp_clear_memoryview(o);
22914  tmp = ((PyObject*)p->from_object);
22915  p->from_object = Py_None; Py_INCREF(Py_None);
22916  Py_XDECREF(tmp);
22917  __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
22918  return 0;
22919 }
22920 
22921 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
22922  return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
22923 }
22924 
22925 static PyMethodDef __pyx_methods__memoryviewslice[] = {
22926  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
22927  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
22928  {0, 0, 0, 0}
22929 };
22930 
22931 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
22932  {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
22933  {0, 0, 0, 0, 0}
22934 };
22935 
22936 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
22937  PyVarObject_HEAD_INIT(0, 0)
22938  "csmoothers._memoryviewslice", /*tp_name*/
22939  sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
22940  0, /*tp_itemsize*/
22941  __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
22942  0, /*tp_print*/
22943  0, /*tp_getattr*/
22944  0, /*tp_setattr*/
22945  #if PY_MAJOR_VERSION < 3
22946  0, /*tp_compare*/
22947  #endif
22948  #if PY_MAJOR_VERSION >= 3
22949  0, /*tp_as_async*/
22950  #endif
22951  #if CYTHON_COMPILING_IN_PYPY
22952  __pyx_memoryview___repr__, /*tp_repr*/
22953  #else
22954  0, /*tp_repr*/
22955  #endif
22956  0, /*tp_as_number*/
22957  0, /*tp_as_sequence*/
22958  0, /*tp_as_mapping*/
22959  0, /*tp_hash*/
22960  0, /*tp_call*/
22961  #if CYTHON_COMPILING_IN_PYPY
22962  __pyx_memoryview___str__, /*tp_str*/
22963  #else
22964  0, /*tp_str*/
22965  #endif
22966  0, /*tp_getattro*/
22967  0, /*tp_setattro*/
22968  0, /*tp_as_buffer*/
22969  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
22970  "Internal class for passing memoryview slices to Python", /*tp_doc*/
22971  __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
22972  __pyx_tp_clear__memoryviewslice, /*tp_clear*/
22973  0, /*tp_richcompare*/
22974  0, /*tp_weaklistoffset*/
22975  0, /*tp_iter*/
22976  0, /*tp_iternext*/
22977  __pyx_methods__memoryviewslice, /*tp_methods*/
22978  0, /*tp_members*/
22979  __pyx_getsets__memoryviewslice, /*tp_getset*/
22980  0, /*tp_base*/
22981  0, /*tp_dict*/
22982  0, /*tp_descr_get*/
22983  0, /*tp_descr_set*/
22984  0, /*tp_dictoffset*/
22985  0, /*tp_init*/
22986  0, /*tp_alloc*/
22987  __pyx_tp_new__memoryviewslice, /*tp_new*/
22988  0, /*tp_free*/
22989  0, /*tp_is_gc*/
22990  0, /*tp_bases*/
22991  0, /*tp_mro*/
22992  0, /*tp_cache*/
22993  0, /*tp_subclasses*/
22994  0, /*tp_weaklist*/
22995  0, /*tp_del*/
22996  0, /*tp_version_tag*/
22997  #if PY_VERSION_HEX >= 0x030400a1
22998  0, /*tp_finalize*/
22999  #endif
23000 };
23001 
23002 static PyMethodDef __pyx_methods[] = {
23003  {0, 0, 0, 0}
23004 };
23005 
23006 #if PY_MAJOR_VERSION >= 3
23007 #if CYTHON_PEP489_MULTI_PHASE_INIT
23008 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
23009 static int __pyx_pymod_exec_csmoothers(PyObject* module); /*proto*/
23010 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
23011  {Py_mod_create, (void*)__pyx_pymod_create},
23012  {Py_mod_exec, (void*)__pyx_pymod_exec_csmoothers},
23013  {0, NULL}
23014 };
23015 #endif
23016 
23017 static struct PyModuleDef __pyx_moduledef = {
23018  PyModuleDef_HEAD_INIT,
23019  "csmoothers",
23020  0, /* m_doc */
23021  #if CYTHON_PEP489_MULTI_PHASE_INIT
23022  0, /* m_size */
23023  #else
23024  -1, /* m_size */
23025  #endif
23026  __pyx_methods /* m_methods */,
23027  #if CYTHON_PEP489_MULTI_PHASE_INIT
23028  __pyx_moduledef_slots, /* m_slots */
23029  #else
23030  NULL, /* m_reload */
23031  #endif
23032  NULL, /* m_traverse */
23033  NULL, /* m_clear */
23034  NULL /* m_free */
23035 };
23036 #endif
23037 
23038 static __Pyx_StringTabEntry __pyx_string_tab[] = {
23039  {&__pyx_n_s_A, __pyx_k_A, sizeof(__pyx_k_A), 0, 0, 1, 1},
23040  {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
23041  {&__pyx_n_s_ASMFactor, __pyx_k_ASMFactor, sizeof(__pyx_k_ASMFactor), 0, 0, 1, 1},
23042  {&__pyx_n_s_ASMFactor___init, __pyx_k_ASMFactor___init, sizeof(__pyx_k_ASMFactor___init), 0, 0, 1, 1},
23043  {&__pyx_n_s_BASMFactor, __pyx_k_BASMFactor, sizeof(__pyx_k_BASMFactor), 0, 0, 1, 1},
23044  {&__pyx_n_s_BASMFactor___init, __pyx_k_BASMFactor___init, sizeof(__pyx_k_BASMFactor___init), 0, 0, 1, 1},
23045  {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
23046  {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
23047  {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
23048  {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
23049  {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
23050  {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
23051  {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
23052  {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
23053  {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
23054  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
23055  {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0},
23056  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
23057  {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
23058  {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
23059  {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
23060  {&__pyx_n_s_L, __pyx_k_L, sizeof(__pyx_k_L), 0, 0, 1, 1},
23061  {&__pyx_n_s_M, __pyx_k_M, sizeof(__pyx_k_M), 0, 0, 1, 1},
23062  {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
23063  {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
23064  {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
23065  {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
23066  {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
23067  {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
23068  {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
23069  {&__pyx_n_s_R, __pyx_k_R, sizeof(__pyx_k_R), 0, 0, 1, 1},
23070  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
23071  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
23072  {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
23073  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
23074  {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
23075  {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
23076  {&__pyx_n_s_asmFactor, __pyx_k_asmFactor, sizeof(__pyx_k_asmFactor), 0, 0, 1, 1},
23077  {&__pyx_n_s_asm_NR_prepare, __pyx_k_asm_NR_prepare, sizeof(__pyx_k_asm_NR_prepare), 0, 0, 1, 1},
23078  {&__pyx_n_s_asm_NR_solve, __pyx_k_asm_NR_solve, sizeof(__pyx_k_asm_NR_solve), 0, 0, 1, 1},
23079  {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
23080  {&__pyx_n_s_basmFactor, __pyx_k_basmFactor, sizeof(__pyx_k_basmFactor), 0, 0, 1, 1},
23081  {&__pyx_n_s_basm_NR_prepare, __pyx_k_basm_NR_prepare, sizeof(__pyx_k_basm_NR_prepare), 0, 0, 1, 1},
23082  {&__pyx_n_s_basm_NR_solve, __pyx_k_basm_NR_solve, sizeof(__pyx_k_basm_NR_solve), 0, 0, 1, 1},
23083  {&__pyx_n_s_bs, __pyx_k_bs, sizeof(__pyx_k_bs), 0, 0, 1, 1},
23084  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
23085  {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
23086  {&__pyx_n_s_cASMFactor, __pyx_k_cASMFactor, sizeof(__pyx_k_cASMFactor), 0, 0, 1, 1},
23087  {&__pyx_n_s_cBASMFactor, __pyx_k_cBASMFactor, sizeof(__pyx_k_cBASMFactor), 0, 0, 1, 1},
23088  {&__pyx_n_s_cSparseMatrix, __pyx_k_cSparseMatrix, sizeof(__pyx_k_cSparseMatrix), 0, 0, 1, 1},
23089  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
23090  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
23091  {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
23092  {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
23093  {&__pyx_n_s_csmoothers, __pyx_k_csmoothers, sizeof(__pyx_k_csmoothers), 0, 0, 1, 1},
23094  {&__pyx_n_s_dX, __pyx_k_dX, sizeof(__pyx_k_dX), 0, 0, 1, 1},
23095  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
23096  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
23097  {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
23098  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
23099  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
23100  {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
23101  {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
23102  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
23103  {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
23104  {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
23105  {&__pyx_n_s_gauss_seidel_NR_preare, __pyx_k_gauss_seidel_NR_preare, sizeof(__pyx_k_gauss_seidel_NR_preare), 0, 0, 1, 1},
23106  {&__pyx_n_s_gauss_seidel_NR_solve, __pyx_k_gauss_seidel_NR_solve, sizeof(__pyx_k_gauss_seidel_NR_solve), 0, 0, 1, 1},
23107  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
23108  {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
23109  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
23110  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
23111  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
23112  {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
23113  {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
23114  {&__pyx_n_s_jacobi_NR_prepare, __pyx_k_jacobi_NR_prepare, sizeof(__pyx_k_jacobi_NR_prepare), 0, 0, 1, 1},
23115  {&__pyx_n_s_jacobi_NR_solve, __pyx_k_jacobi_NR_solve, sizeof(__pyx_k_jacobi_NR_solve), 0, 0, 1, 1},
23116  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
23117  {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
23118  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
23119  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
23120  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
23121  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
23122  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
23123  {&__pyx_n_s_nc, __pyx_k_nc, sizeof(__pyx_k_nc), 0, 0, 1, 1},
23124  {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
23125  {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
23126  {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
23127  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
23128  {&__pyx_n_s_nl_gauss_seidel_NR_solve, __pyx_k_nl_gauss_seidel_NR_solve, sizeof(__pyx_k_nl_gauss_seidel_NR_solve), 0, 0, 1, 1},
23129  {&__pyx_n_s_nl_jacobi_NR_solve, __pyx_k_nl_jacobi_NR_solve, sizeof(__pyx_k_nl_jacobi_NR_solve), 0, 0, 1, 1},
23130  {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
23131  {&__pyx_n_s_node_order, __pyx_k_node_order, sizeof(__pyx_k_node_order), 0, 0, 1, 1},
23132  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
23133  {&__pyx_n_s_nr, __pyx_k_nr, sizeof(__pyx_k_nr), 0, 0, 1, 1},
23134  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
23135  {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
23136  {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
23137  {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
23138  {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1},
23139  {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
23140  {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
23141  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
23142  {&__pyx_kp_s_proteus_csmoothers_pyx, __pyx_k_proteus_csmoothers_pyx, sizeof(__pyx_k_proteus_csmoothers_pyx), 0, 0, 1, 0},
23143  {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
23144  {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
23145  {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
23146  {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
23147  {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
23148  {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
23149  {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
23150  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
23151  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
23152  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
23153  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
23154  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
23155  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
23156  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
23157  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
23158  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
23159  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
23160  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
23161  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
23162  {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
23163  {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
23164  {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
23165  {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
23166  {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
23167  {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
23168  {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
23169  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
23170  {&__pyx_n_s_tol, __pyx_k_tol, sizeof(__pyx_k_tol), 0, 0, 1, 1},
23171  {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
23172  {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
23173  {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
23174  {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
23175  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
23176  {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1},
23177  {0, 0, 0, 0, 0, 0, 0}
23178 };
23179 static int __Pyx_InitCachedBuiltins(void) {
23180  __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 5, __pyx_L1_error)
23181  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
23182  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(2, 229, __pyx_L1_error)
23183  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(2, 242, __pyx_L1_error)
23184  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(2, 810, __pyx_L1_error)
23185  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 1000, __pyx_L1_error)
23186  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 147, __pyx_L1_error)
23187  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 150, __pyx_L1_error)
23188  __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 399, __pyx_L1_error)
23189  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 608, __pyx_L1_error)
23190  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 827, __pyx_L1_error)
23191  return 0;
23192  __pyx_L1_error:;
23193  return -1;
23194 }
23195 
23196 static int __Pyx_InitCachedConstants(void) {
23197  __Pyx_RefNannyDeclarations
23198  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
23199 
23200  /* "(tree fragment)":2
23201  * def __reduce_cython__(self):
23202  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23203  * def __setstate_cython__(self, __pyx_state):
23204  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23205  */
23206  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 2, __pyx_L1_error)
23207  __Pyx_GOTREF(__pyx_tuple_);
23208  __Pyx_GIVEREF(__pyx_tuple_);
23209 
23210  /* "(tree fragment)":4
23211  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23212  * def __setstate_cython__(self, __pyx_state):
23213  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23214  */
23215  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 4, __pyx_L1_error)
23216  __Pyx_GOTREF(__pyx_tuple__2);
23217  __Pyx_GIVEREF(__pyx_tuple__2);
23218 
23219  /* "(tree fragment)":2
23220  * def __reduce_cython__(self):
23221  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23222  * def __setstate_cython__(self, __pyx_state):
23223  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23224  */
23225  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 2, __pyx_L1_error)
23226  __Pyx_GOTREF(__pyx_tuple__3);
23227  __Pyx_GIVEREF(__pyx_tuple__3);
23228 
23229  /* "(tree fragment)":4
23230  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23231  * def __setstate_cython__(self, __pyx_state):
23232  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23233  */
23234  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 4, __pyx_L1_error)
23235  __Pyx_GOTREF(__pyx_tuple__4);
23236  __Pyx_GIVEREF(__pyx_tuple__4);
23237 
23238  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":229
23239  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
23240  * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
23241  * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
23242  *
23243  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
23244  */
23245  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(2, 229, __pyx_L1_error)
23246  __Pyx_GOTREF(__pyx_tuple__5);
23247  __Pyx_GIVEREF(__pyx_tuple__5);
23248 
23249  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":233
23250  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
23251  * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
23252  * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
23253  *
23254  * info.buf = PyArray_DATA(self)
23255  */
23256  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(2, 233, __pyx_L1_error)
23257  __Pyx_GOTREF(__pyx_tuple__6);
23258  __Pyx_GIVEREF(__pyx_tuple__6);
23259 
23260  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":263
23261  * if ((descr.byteorder == c'>' and little_endian) or
23262  * (descr.byteorder == c'<' and not little_endian)):
23263  * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
23264  * if t == NPY_BYTE: f = "b"
23265  * elif t == NPY_UBYTE: f = "B"
23266  */
23267  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(2, 263, __pyx_L1_error)
23268  __Pyx_GOTREF(__pyx_tuple__7);
23269  __Pyx_GIVEREF(__pyx_tuple__7);
23270 
23271  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":810
23272  *
23273  * if (end - f) - <int>(new_offset - offset[0]) < 15:
23274  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
23275  *
23276  * if ((child.byteorder == c'>' and little_endian) or
23277  */
23278  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(2, 810, __pyx_L1_error)
23279  __Pyx_GOTREF(__pyx_tuple__8);
23280  __Pyx_GIVEREF(__pyx_tuple__8);
23281 
23282  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":814
23283  * if ((child.byteorder == c'>' and little_endian) or
23284  * (child.byteorder == c'<' and not little_endian)):
23285  * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
23286  * # One could encode it in the format string and have Cython
23287  * # complain instead, BUT: < and > in format strings also imply
23288  */
23289  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 814, __pyx_L1_error)
23290  __Pyx_GOTREF(__pyx_tuple__9);
23291  __Pyx_GIVEREF(__pyx_tuple__9);
23292 
23293  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":834
23294  * t = child.type_num
23295  * if end - f < 5:
23296  * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
23297  *
23298  * # Until ticket #99 is fixed, use integers to avoid warnings
23299  */
23300  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 834, __pyx_L1_error)
23301  __Pyx_GOTREF(__pyx_tuple__10);
23302  __Pyx_GIVEREF(__pyx_tuple__10);
23303 
23304  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1000
23305  * _import_array()
23306  * except Exception:
23307  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
23308  *
23309  * cdef inline int import_umath() except -1:
23310  */
23311  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 1000, __pyx_L1_error)
23312  __Pyx_GOTREF(__pyx_tuple__11);
23313  __Pyx_GIVEREF(__pyx_tuple__11);
23314 
23315  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1006
23316  * _import_umath()
23317  * except Exception:
23318  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
23319  *
23320  * cdef inline int import_ufunc() except -1:
23321  */
23322  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 1006, __pyx_L1_error)
23323  __Pyx_GOTREF(__pyx_tuple__12);
23324  __Pyx_GIVEREF(__pyx_tuple__12);
23325 
23326  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1012
23327  * _import_umath()
23328  * except Exception:
23329  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
23330  */
23331  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(2, 1012, __pyx_L1_error)
23332  __Pyx_GOTREF(__pyx_tuple__13);
23333  __Pyx_GIVEREF(__pyx_tuple__13);
23334 
23335  /* "View.MemoryView":132
23336  *
23337  * if not self.ndim:
23338  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
23339  *
23340  * if itemsize <= 0:
23341  */
23342  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 132, __pyx_L1_error)
23343  __Pyx_GOTREF(__pyx_tuple__14);
23344  __Pyx_GIVEREF(__pyx_tuple__14);
23345 
23346  /* "View.MemoryView":135
23347  *
23348  * if itemsize <= 0:
23349  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
23350  *
23351  * if not isinstance(format, bytes):
23352  */
23353  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 135, __pyx_L1_error)
23354  __Pyx_GOTREF(__pyx_tuple__15);
23355  __Pyx_GIVEREF(__pyx_tuple__15);
23356 
23357  /* "View.MemoryView":138
23358  *
23359  * if not isinstance(format, bytes):
23360  * format = format.encode('ASCII') # <<<<<<<<<<<<<<
23361  * self._format = format # keep a reference to the byte string
23362  * self.format = self._format
23363  */
23364  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 138, __pyx_L1_error)
23365  __Pyx_GOTREF(__pyx_tuple__16);
23366  __Pyx_GIVEREF(__pyx_tuple__16);
23367 
23368  /* "View.MemoryView":147
23369  *
23370  * if not self._shape:
23371  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
23372  *
23373  *
23374  */
23375  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 147, __pyx_L1_error)
23376  __Pyx_GOTREF(__pyx_tuple__17);
23377  __Pyx_GIVEREF(__pyx_tuple__17);
23378 
23379  /* "View.MemoryView":175
23380  * self.data = <char *>malloc(self.len)
23381  * if not self.data:
23382  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
23383  *
23384  * if self.dtype_is_object:
23385  */
23386  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 175, __pyx_L1_error)
23387  __Pyx_GOTREF(__pyx_tuple__18);
23388  __Pyx_GIVEREF(__pyx_tuple__18);
23389 
23390  /* "View.MemoryView":191
23391  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
23392  * if not (flags & bufmode):
23393  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
23394  * info.buf = self.data
23395  * info.len = self.len
23396  */
23397  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 191, __pyx_L1_error)
23398  __Pyx_GOTREF(__pyx_tuple__19);
23399  __Pyx_GIVEREF(__pyx_tuple__19);
23400 
23401  /* "(tree fragment)":2
23402  * def __reduce_cython__(self):
23403  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23404  * def __setstate_cython__(self, __pyx_state):
23405  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23406  */
23407  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 2, __pyx_L1_error)
23408  __Pyx_GOTREF(__pyx_tuple__20);
23409  __Pyx_GIVEREF(__pyx_tuple__20);
23410 
23411  /* "(tree fragment)":4
23412  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23413  * def __setstate_cython__(self, __pyx_state):
23414  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23415  */
23416  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 4, __pyx_L1_error)
23417  __Pyx_GOTREF(__pyx_tuple__21);
23418  __Pyx_GIVEREF(__pyx_tuple__21);
23419 
23420  /* "View.MemoryView":413
23421  * def __setitem__(memoryview self, object index, object value):
23422  * if self.view.readonly:
23423  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
23424  *
23425  * have_slices, index = _unellipsify(index, self.view.ndim)
23426  */
23427  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 413, __pyx_L1_error)
23428  __Pyx_GOTREF(__pyx_tuple__22);
23429  __Pyx_GIVEREF(__pyx_tuple__22);
23430 
23431  /* "View.MemoryView":490
23432  * result = struct.unpack(self.view.format, bytesitem)
23433  * except struct.error:
23434  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
23435  * else:
23436  * if len(self.view.format) == 1:
23437  */
23438  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 490, __pyx_L1_error)
23439  __Pyx_GOTREF(__pyx_tuple__23);
23440  __Pyx_GIVEREF(__pyx_tuple__23);
23441 
23442  /* "View.MemoryView":515
23443  * def __getbuffer__(self, Py_buffer *info, int flags):
23444  * if flags & PyBUF_WRITABLE and self.view.readonly:
23445  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
23446  *
23447  * if flags & PyBUF_STRIDES:
23448  */
23449  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 515, __pyx_L1_error)
23450  __Pyx_GOTREF(__pyx_tuple__24);
23451  __Pyx_GIVEREF(__pyx_tuple__24);
23452 
23453  /* "View.MemoryView":565
23454  * if self.view.strides == NULL:
23455  *
23456  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
23457  *
23458  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
23459  */
23460  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 565, __pyx_L1_error)
23461  __Pyx_GOTREF(__pyx_tuple__25);
23462  __Pyx_GIVEREF(__pyx_tuple__25);
23463 
23464  /* "View.MemoryView":572
23465  * def suboffsets(self):
23466  * if self.view.suboffsets == NULL:
23467  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
23468  *
23469  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
23470  */
23471  __pyx_tuple__26 = PyTuple_New(1); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 572, __pyx_L1_error)
23472  __Pyx_GOTREF(__pyx_tuple__26);
23473  __Pyx_INCREF(__pyx_int_neg_1);
23474  __Pyx_GIVEREF(__pyx_int_neg_1);
23475  PyTuple_SET_ITEM(__pyx_tuple__26, 0, __pyx_int_neg_1);
23476  __Pyx_GIVEREF(__pyx_tuple__26);
23477 
23478  /* "(tree fragment)":2
23479  * def __reduce_cython__(self):
23480  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23481  * def __setstate_cython__(self, __pyx_state):
23482  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23483  */
23484  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 2, __pyx_L1_error)
23485  __Pyx_GOTREF(__pyx_tuple__27);
23486  __Pyx_GIVEREF(__pyx_tuple__27);
23487 
23488  /* "(tree fragment)":4
23489  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23490  * def __setstate_cython__(self, __pyx_state):
23491  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23492  */
23493  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 4, __pyx_L1_error)
23494  __Pyx_GOTREF(__pyx_tuple__28);
23495  __Pyx_GIVEREF(__pyx_tuple__28);
23496 
23497  /* "View.MemoryView":677
23498  * if item is Ellipsis:
23499  * if not seen_ellipsis:
23500  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
23501  * seen_ellipsis = True
23502  * else:
23503  */
23504  __pyx_slice__29 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__29)) __PYX_ERR(1, 677, __pyx_L1_error)
23505  __Pyx_GOTREF(__pyx_slice__29);
23506  __Pyx_GIVEREF(__pyx_slice__29);
23507 
23508  /* "View.MemoryView":680
23509  * seen_ellipsis = True
23510  * else:
23511  * result.append(slice(None)) # <<<<<<<<<<<<<<
23512  * have_slices = True
23513  * else:
23514  */
23515  __pyx_slice__30 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__30)) __PYX_ERR(1, 680, __pyx_L1_error)
23516  __Pyx_GOTREF(__pyx_slice__30);
23517  __Pyx_GIVEREF(__pyx_slice__30);
23518 
23519  /* "View.MemoryView":691
23520  * nslices = ndim - len(result)
23521  * if nslices:
23522  * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
23523  *
23524  * return have_slices or nslices, tuple(result)
23525  */
23526  __pyx_slice__31 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__31)) __PYX_ERR(1, 691, __pyx_L1_error)
23527  __Pyx_GOTREF(__pyx_slice__31);
23528  __Pyx_GIVEREF(__pyx_slice__31);
23529 
23530  /* "View.MemoryView":698
23531  * for suboffset in suboffsets[:ndim]:
23532  * if suboffset >= 0:
23533  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
23534  *
23535  *
23536  */
23537  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 698, __pyx_L1_error)
23538  __Pyx_GOTREF(__pyx_tuple__32);
23539  __Pyx_GIVEREF(__pyx_tuple__32);
23540 
23541  /* "(tree fragment)":2
23542  * def __reduce_cython__(self):
23543  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23544  * def __setstate_cython__(self, __pyx_state):
23545  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23546  */
23547  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 2, __pyx_L1_error)
23548  __Pyx_GOTREF(__pyx_tuple__33);
23549  __Pyx_GIVEREF(__pyx_tuple__33);
23550 
23551  /* "(tree fragment)":4
23552  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23553  * def __setstate_cython__(self, __pyx_state):
23554  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23555  */
23556  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 4, __pyx_L1_error)
23557  __Pyx_GOTREF(__pyx_tuple__34);
23558  __Pyx_GIVEREF(__pyx_tuple__34);
23559 
23560  /* "csmoothers.pyx":5
23561  * cimport numpy as np
23562  *
23563  * class ASMFactor(object): # <<<<<<<<<<<<<<
23564  *
23565  * def __init__(self, L):
23566  */
23567  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 5, __pyx_L1_error)
23568  __Pyx_GOTREF(__pyx_tuple__35);
23569  __Pyx_GIVEREF(__pyx_tuple__35);
23570 
23571  /* "csmoothers.pyx":7
23572  * class ASMFactor(object):
23573  *
23574  * def __init__(self, L): # <<<<<<<<<<<<<<
23575  * self.L = L
23576  * self._cASMFactor = cASMFactor(self.L._cSparseMatrix)
23577  */
23578  __pyx_tuple__36 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_L); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 7, __pyx_L1_error)
23579  __Pyx_GOTREF(__pyx_tuple__36);
23580  __Pyx_GIVEREF(__pyx_tuple__36);
23581  __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_init, 7, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 7, __pyx_L1_error)
23582 
23583  /* "csmoothers.pyx":42
23584  *
23585  *
23586  * class BASMFactor(object): # <<<<<<<<<<<<<<
23587  *
23588  * def __init__(self, L, bs):
23589  */
23590  __pyx_tuple__38 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 42, __pyx_L1_error)
23591  __Pyx_GOTREF(__pyx_tuple__38);
23592  __Pyx_GIVEREF(__pyx_tuple__38);
23593 
23594  /* "csmoothers.pyx":44
23595  * class BASMFactor(object):
23596  *
23597  * def __init__(self, L, bs): # <<<<<<<<<<<<<<
23598  * self.L = L
23599  * self.bs = bs
23600  */
23601  __pyx_tuple__39 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_L, __pyx_n_s_bs); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 44, __pyx_L1_error)
23602  __Pyx_GOTREF(__pyx_tuple__39);
23603  __Pyx_GIVEREF(__pyx_tuple__39);
23604  __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_init, 44, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 44, __pyx_L1_error)
23605 
23606  /* "csmoothers.pyx":84
23607  * self.subdomain_col_pivots)
23608  *
23609  * def jacobi_NR_prepare(A, w, tol, M): # <<<<<<<<<<<<<<
23610  * """
23611  *
23612  */
23613  __pyx_tuple__41 = PyTuple_Pack(4, __pyx_n_s_A, __pyx_n_s_w, __pyx_n_s_tol, __pyx_n_s_M); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 84, __pyx_L1_error)
23614  __Pyx_GOTREF(__pyx_tuple__41);
23615  __Pyx_GIVEREF(__pyx_tuple__41);
23616  __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_jacobi_NR_prepare, 84, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 84, __pyx_L1_error)
23617 
23618  /* "csmoothers.pyx":109
23619  * cjacobi_NR_prepare(&AS, w, tol, &M[0])
23620  *
23621  * def jacobi_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
23622  * """
23623  *
23624  */
23625  __pyx_tuple__43 = PyTuple_Pack(5, __pyx_n_s_A, __pyx_n_s_M, __pyx_n_s_R, __pyx_n_s_node_order, __pyx_n_s_dX); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 109, __pyx_L1_error)
23626  __Pyx_GOTREF(__pyx_tuple__43);
23627  __Pyx_GIVEREF(__pyx_tuple__43);
23628  __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_jacobi_NR_solve, 109, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 109, __pyx_L1_error)
23629 
23630  /* "csmoothers.pyx":136
23631  * cjacobi_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
23632  *
23633  * def nl_jacobi_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
23634  * """
23635  *
23636  */
23637  __pyx_tuple__45 = PyTuple_Pack(6, __pyx_n_s_A, __pyx_n_s_R, __pyx_n_s_node_order, __pyx_n_s_w, __pyx_n_s_tol, __pyx_n_s_dX); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 136, __pyx_L1_error)
23638  __Pyx_GOTREF(__pyx_tuple__45);
23639  __Pyx_GIVEREF(__pyx_tuple__45);
23640  __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_nl_jacobi_NR_solve, 136, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 136, __pyx_L1_error)
23641 
23642  /* "csmoothers.pyx":165
23643  * cnl_jacobi_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
23644  *
23645  * def gauss_seidel_NR_preare(A, w, tol, M): # <<<<<<<<<<<<<<
23646  * """
23647  *
23648  */
23649  __pyx_tuple__47 = PyTuple_Pack(4, __pyx_n_s_A, __pyx_n_s_w, __pyx_n_s_tol, __pyx_n_s_M); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 165, __pyx_L1_error)
23650  __Pyx_GOTREF(__pyx_tuple__47);
23651  __Pyx_GIVEREF(__pyx_tuple__47);
23652  __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_gauss_seidel_NR_preare, 165, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 165, __pyx_L1_error)
23653 
23654  /* "csmoothers.pyx":190
23655  * cgauss_seidel_NR_prepare(&AS, w, tol, &M[0])
23656  *
23657  * def gauss_seidel_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
23658  * """
23659  *
23660  */
23661  __pyx_tuple__49 = PyTuple_Pack(5, __pyx_n_s_A, __pyx_n_s_M, __pyx_n_s_R, __pyx_n_s_node_order, __pyx_n_s_dX); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 190, __pyx_L1_error)
23662  __Pyx_GOTREF(__pyx_tuple__49);
23663  __Pyx_GIVEREF(__pyx_tuple__49);
23664  __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_gauss_seidel_NR_solve, 190, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 190, __pyx_L1_error)
23665 
23666  /* "csmoothers.pyx":217
23667  * cgauss_seidel_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
23668  *
23669  * def nl_gauss_seidel_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
23670  * """
23671  *
23672  */
23673  __pyx_tuple__51 = PyTuple_Pack(6, __pyx_n_s_A, __pyx_n_s_R, __pyx_n_s_node_order, __pyx_n_s_w, __pyx_n_s_tol, __pyx_n_s_dX); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 217, __pyx_L1_error)
23674  __Pyx_GOTREF(__pyx_tuple__51);
23675  __Pyx_GIVEREF(__pyx_tuple__51);
23676  __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_nl_gauss_seidel_NR_solve, 217, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 217, __pyx_L1_error)
23677 
23678  /* "csmoothers.pyx":251
23679  * cnl_gauss_seidel_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
23680  *
23681  * def asm_NR_prepare(A, asmFactor): # <<<<<<<<<<<<<<
23682  * """
23683  *
23684  */
23685  __pyx_tuple__53 = PyTuple_Pack(2, __pyx_n_s_A, __pyx_n_s_asmFactor); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 251, __pyx_L1_error)
23686  __Pyx_GOTREF(__pyx_tuple__53);
23687  __Pyx_GIVEREF(__pyx_tuple__53);
23688  __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_asm_NR_prepare, 251, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 251, __pyx_L1_error)
23689 
23690  /* "csmoothers.pyx":277
23691  * asmFactor.subdomain_pivots)
23692  *
23693  * def asm_NR_solve(A, w, asmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
23694  * """
23695  *
23696  */
23697  __pyx_tuple__55 = PyTuple_Pack(6, __pyx_n_s_A, __pyx_n_s_w, __pyx_n_s_asmFactor, __pyx_n_s_node_order, __pyx_n_s_R, __pyx_n_s_dX); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 277, __pyx_L1_error)
23698  __Pyx_GOTREF(__pyx_tuple__55);
23699  __Pyx_GIVEREF(__pyx_tuple__55);
23700  __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_asm_NR_solve, 277, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 277, __pyx_L1_error)
23701 
23702  /* "csmoothers.pyx":321
23703  * asmFactor.subdomain_pivots)
23704  *
23705  * def basm_NR_prepare(A, basmFactor): # <<<<<<<<<<<<<<
23706  * """
23707  *
23708  */
23709  __pyx_tuple__57 = PyTuple_Pack(2, __pyx_n_s_A, __pyx_n_s_basmFactor); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 321, __pyx_L1_error)
23710  __Pyx_GOTREF(__pyx_tuple__57);
23711  __Pyx_GIVEREF(__pyx_tuple__57);
23712  __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_basm_NR_prepare, 321, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 321, __pyx_L1_error)
23713 
23714  /* "csmoothers.pyx":350
23715  *
23716  *
23717  * def basm_NR_solve(A, w, basmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
23718  * """
23719  *
23720  */
23721  __pyx_tuple__59 = PyTuple_Pack(6, __pyx_n_s_A, __pyx_n_s_w, __pyx_n_s_basmFactor, __pyx_n_s_node_order, __pyx_n_s_R, __pyx_n_s_dX); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 350, __pyx_L1_error)
23722  __Pyx_GOTREF(__pyx_tuple__59);
23723  __Pyx_GIVEREF(__pyx_tuple__59);
23724  __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_basm_NR_solve, 350, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 350, __pyx_L1_error)
23725 
23726  /* "View.MemoryView":285
23727  * return self.name
23728  *
23729  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
23730  * cdef strided = Enum("<strided and direct>") # default
23731  * cdef indirect = Enum("<strided and indirect>")
23732  */
23733  __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(1, 285, __pyx_L1_error)
23734  __Pyx_GOTREF(__pyx_tuple__61);
23735  __Pyx_GIVEREF(__pyx_tuple__61);
23736 
23737  /* "View.MemoryView":286
23738  *
23739  * cdef generic = Enum("<strided and direct or indirect>")
23740  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
23741  * cdef indirect = Enum("<strided and indirect>")
23742  *
23743  */
23744  __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(1, 286, __pyx_L1_error)
23745  __Pyx_GOTREF(__pyx_tuple__62);
23746  __Pyx_GIVEREF(__pyx_tuple__62);
23747 
23748  /* "View.MemoryView":287
23749  * cdef generic = Enum("<strided and direct or indirect>")
23750  * cdef strided = Enum("<strided and direct>") # default
23751  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
23752  *
23753  *
23754  */
23755  __pyx_tuple__63 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(1, 287, __pyx_L1_error)
23756  __Pyx_GOTREF(__pyx_tuple__63);
23757  __Pyx_GIVEREF(__pyx_tuple__63);
23758 
23759  /* "View.MemoryView":290
23760  *
23761  *
23762  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
23763  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
23764  *
23765  */
23766  __pyx_tuple__64 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(1, 290, __pyx_L1_error)
23767  __Pyx_GOTREF(__pyx_tuple__64);
23768  __Pyx_GIVEREF(__pyx_tuple__64);
23769 
23770  /* "View.MemoryView":291
23771  *
23772  * cdef contiguous = Enum("<contiguous and direct>")
23773  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
23774  *
23775  *
23776  */
23777  __pyx_tuple__65 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(1, 291, __pyx_L1_error)
23778  __Pyx_GOTREF(__pyx_tuple__65);
23779  __Pyx_GIVEREF(__pyx_tuple__65);
23780 
23781  /* "(tree fragment)":1
23782  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
23783  * if __pyx_checksum != 0xb068931:
23784  * from pickle import PickleError as __pyx_PickleError
23785  */
23786  __pyx_tuple__66 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(1, 1, __pyx_L1_error)
23787  __Pyx_GOTREF(__pyx_tuple__66);
23788  __Pyx_GIVEREF(__pyx_tuple__66);
23789  __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(1, 1, __pyx_L1_error)
23790  __Pyx_RefNannyFinishContext();
23791  return 0;
23792  __pyx_L1_error:;
23793  __Pyx_RefNannyFinishContext();
23794  return -1;
23795 }
23796 
23797 static int __Pyx_InitGlobals(void) {
23798  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
23799  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
23800  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23801  __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
23802  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23803  return 0;
23804  __pyx_L1_error:;
23805  return -1;
23806 }
23807 
23808 static int __Pyx_modinit_global_init_code(void); /*proto*/
23809 static int __Pyx_modinit_variable_export_code(void); /*proto*/
23810 static int __Pyx_modinit_function_export_code(void); /*proto*/
23811 static int __Pyx_modinit_type_init_code(void); /*proto*/
23812 static int __Pyx_modinit_type_import_code(void); /*proto*/
23813 static int __Pyx_modinit_variable_import_code(void); /*proto*/
23814 static int __Pyx_modinit_function_import_code(void); /*proto*/
23815 
23816 static int __Pyx_modinit_global_init_code(void) {
23817  __Pyx_RefNannyDeclarations
23818  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
23819  /*--- Global init code ---*/
23820  generic = Py_None; Py_INCREF(Py_None);
23821  strided = Py_None; Py_INCREF(Py_None);
23822  indirect = Py_None; Py_INCREF(Py_None);
23823  contiguous = Py_None; Py_INCREF(Py_None);
23824  indirect_contiguous = Py_None; Py_INCREF(Py_None);
23825  __Pyx_RefNannyFinishContext();
23826  return 0;
23827 }
23828 
23829 static int __Pyx_modinit_variable_export_code(void) {
23830  __Pyx_RefNannyDeclarations
23831  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
23832  /*--- Variable export code ---*/
23833  __Pyx_RefNannyFinishContext();
23834  return 0;
23835 }
23836 
23837 static int __Pyx_modinit_function_export_code(void) {
23838  __Pyx_RefNannyDeclarations
23839  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
23840  /*--- Function export code ---*/
23841  __Pyx_RefNannyFinishContext();
23842  return 0;
23843 }
23844 
23845 static int __Pyx_modinit_type_init_code(void) {
23846  __Pyx_RefNannyDeclarations
23847  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
23848  /*--- Type init code ---*/
23849  if (PyType_Ready(&__pyx_type_10csmoothers_cASMFactor) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
23850  __pyx_type_10csmoothers_cASMFactor.tp_print = 0;
23851  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10csmoothers_cASMFactor.tp_dictoffset && __pyx_type_10csmoothers_cASMFactor.tp_getattro == PyObject_GenericGetAttr)) {
23852  __pyx_type_10csmoothers_cASMFactor.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23853  }
23854  if (PyObject_SetAttrString(__pyx_m, "cASMFactor", (PyObject *)&__pyx_type_10csmoothers_cASMFactor) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
23855  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_10csmoothers_cASMFactor) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
23856  __pyx_ptype_10csmoothers_cASMFactor = &__pyx_type_10csmoothers_cASMFactor;
23857  if (PyType_Ready(&__pyx_type_10csmoothers_cBASMFactor) < 0) __PYX_ERR(0, 50, __pyx_L1_error)
23858  __pyx_type_10csmoothers_cBASMFactor.tp_print = 0;
23859  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10csmoothers_cBASMFactor.tp_dictoffset && __pyx_type_10csmoothers_cBASMFactor.tp_getattro == PyObject_GenericGetAttr)) {
23860  __pyx_type_10csmoothers_cBASMFactor.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23861  }
23862  if (PyObject_SetAttrString(__pyx_m, "cBASMFactor", (PyObject *)&__pyx_type_10csmoothers_cBASMFactor) < 0) __PYX_ERR(0, 50, __pyx_L1_error)
23863  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_10csmoothers_cBASMFactor) < 0) __PYX_ERR(0, 50, __pyx_L1_error)
23864  __pyx_ptype_10csmoothers_cBASMFactor = &__pyx_type_10csmoothers_cBASMFactor;
23865  __pyx_vtabptr_array = &__pyx_vtable_array;
23866  __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
23867  if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 104, __pyx_L1_error)
23868  __pyx_type___pyx_array.tp_print = 0;
23869  if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 104, __pyx_L1_error)
23870  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 104, __pyx_L1_error)
23871  __pyx_array_type = &__pyx_type___pyx_array;
23872  if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 278, __pyx_L1_error)
23873  __pyx_type___pyx_MemviewEnum.tp_print = 0;
23874  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
23875  __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23876  }
23877  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 278, __pyx_L1_error)
23878  __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
23879  __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
23880  __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
23881  __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
23882  __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
23883  __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
23884  __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
23885  __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
23886  __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
23887  if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 329, __pyx_L1_error)
23888  __pyx_type___pyx_memoryview.tp_print = 0;
23889  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
23890  __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23891  }
23892  if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 329, __pyx_L1_error)
23893  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 329, __pyx_L1_error)
23894  __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
23895  __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
23896  __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
23897  __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
23898  __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
23899  __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
23900  if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 960, __pyx_L1_error)
23901  __pyx_type___pyx_memoryviewslice.tp_print = 0;
23902  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
23903  __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23904  }
23905  if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 960, __pyx_L1_error)
23906  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 960, __pyx_L1_error)
23907  __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
23908  __Pyx_RefNannyFinishContext();
23909  return 0;
23910  __pyx_L1_error:;
23911  __Pyx_RefNannyFinishContext();
23912  return -1;
23913 }
23914 
23915 static int __Pyx_modinit_type_import_code(void) {
23916  __Pyx_RefNannyDeclarations
23917  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
23918  /*--- Type import code ---*/
23919  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type",
23920  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
23921  sizeof(PyTypeObject),
23922  #else
23923  sizeof(PyHeapTypeObject),
23924  #endif
23925  0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(3, 9, __pyx_L1_error)
23926  __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(2, 164, __pyx_L1_error)
23927  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(2, 186, __pyx_L1_error)
23928  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(2, 190, __pyx_L1_error)
23929  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(2, 199, __pyx_L1_error)
23930  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(2, 872, __pyx_L1_error)
23931  __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix = __Pyx_ImportType("proteus.superluWrappers", "cSparseMatrix", sizeof(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix), 1); if (unlikely(!__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix)) __PYX_ERR(4, 67, __pyx_L1_error)
23932  __Pyx_RefNannyFinishContext();
23933  return 0;
23934  __pyx_L1_error:;
23935  __Pyx_RefNannyFinishContext();
23936  return -1;
23937 }
23938 
23939 static int __Pyx_modinit_variable_import_code(void) {
23940  __Pyx_RefNannyDeclarations
23941  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
23942  /*--- Variable import code ---*/
23943  __Pyx_RefNannyFinishContext();
23944  return 0;
23945 }
23946 
23947 static int __Pyx_modinit_function_import_code(void) {
23948  __Pyx_RefNannyDeclarations
23949  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
23950  /*--- Function import code ---*/
23951  __Pyx_RefNannyFinishContext();
23952  return 0;
23953 }
23954 
23955 
23956 #if PY_MAJOR_VERSION < 3
23957 #ifdef CYTHON_NO_PYINIT_EXPORT
23958 #define __Pyx_PyMODINIT_FUNC void
23959 #else
23960 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
23961 #endif
23962 #else
23963 #ifdef CYTHON_NO_PYINIT_EXPORT
23964 #define __Pyx_PyMODINIT_FUNC PyObject *
23965 #else
23966 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
23967 #endif
23968 #endif
23969 #ifndef CYTHON_SMALL_CODE
23970 #if defined(__clang__)
23971  #define CYTHON_SMALL_CODE
23972 #elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)))
23973  #define CYTHON_SMALL_CODE __attribute__((cold))
23974 #else
23975  #define CYTHON_SMALL_CODE
23976 #endif
23977 #endif
23978 
23979 
23980 #if PY_MAJOR_VERSION < 3
23981 __Pyx_PyMODINIT_FUNC initcsmoothers(void) CYTHON_SMALL_CODE; /*proto*/
23982 __Pyx_PyMODINIT_FUNC initcsmoothers(void)
23983 #else
23984 __Pyx_PyMODINIT_FUNC PyInit_csmoothers(void) CYTHON_SMALL_CODE; /*proto*/
23985 __Pyx_PyMODINIT_FUNC PyInit_csmoothers(void)
23986 #if CYTHON_PEP489_MULTI_PHASE_INIT
23987 {
23988  return PyModuleDef_Init(&__pyx_moduledef);
23989 }
23990 static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) {
23991  PyObject *value = PyObject_GetAttrString(spec, from_name);
23992  int result = 0;
23993  if (likely(value)) {
23994  result = PyDict_SetItemString(moddict, to_name, value);
23995  Py_DECREF(value);
23996  } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
23997  PyErr_Clear();
23998  } else {
23999  result = -1;
24000  }
24001  return result;
24002 }
24003 static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
24004  PyObject *module = NULL, *moddict, *modname;
24005  if (__pyx_m)
24006  return __Pyx_NewRef(__pyx_m);
24007  modname = PyObject_GetAttrString(spec, "name");
24008  if (unlikely(!modname)) goto bad;
24009  module = PyModule_NewObject(modname);
24010  Py_DECREF(modname);
24011  if (unlikely(!module)) goto bad;
24012  moddict = PyModule_GetDict(module);
24013  if (unlikely(!moddict)) goto bad;
24014  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad;
24015  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad;
24016  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad;
24017  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad;
24018  return module;
24019 bad:
24020  Py_XDECREF(module);
24021  return NULL;
24022 }
24023 
24024 
24025 static int __pyx_pymod_exec_csmoothers(PyObject *__pyx_pyinit_module)
24026 #endif
24027 #endif
24028 {
24029  PyObject *__pyx_t_1 = NULL;
24030  PyObject *__pyx_t_2 = NULL;
24031  PyObject *__pyx_t_3 = NULL;
24032  static PyThread_type_lock __pyx_t_4[8];
24033  __Pyx_RefNannyDeclarations
24034  #if CYTHON_PEP489_MULTI_PHASE_INIT
24035  if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0;
24036  #elif PY_MAJOR_VERSION >= 3
24037  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
24038  #endif
24039  #if CYTHON_REFNANNY
24040 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
24041 if (!__Pyx_RefNanny) {
24042  PyErr_Clear();
24043  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
24044  if (!__Pyx_RefNanny)
24045  Py_FatalError("failed to import 'refnanny' module");
24046 }
24047 #endif
24048  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_csmoothers(void)", 0);
24049  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24050  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
24051  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
24052  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
24053  #ifdef __Pyx_CyFunction_USED
24054  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24055  #endif
24056  #ifdef __Pyx_FusedFunction_USED
24057  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24058  #endif
24059  #ifdef __Pyx_Coroutine_USED
24060  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24061  #endif
24062  #ifdef __Pyx_Generator_USED
24063  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24064  #endif
24065  #ifdef __Pyx_AsyncGen_USED
24066  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24067  #endif
24068  #ifdef __Pyx_StopAsyncIteration_USED
24069  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24070  #endif
24071  /*--- Library function declarations ---*/
24072  /*--- Threads initialization code ---*/
24073  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
24074  #ifdef WITH_THREAD /* Python build with threading support? */
24075  PyEval_InitThreads();
24076  #endif
24077  #endif
24078  /*--- Module creation code ---*/
24079  #if CYTHON_PEP489_MULTI_PHASE_INIT
24080  __pyx_m = __pyx_pyinit_module;
24081  Py_INCREF(__pyx_m);
24082  #else
24083  #if PY_MAJOR_VERSION < 3
24084  __pyx_m = Py_InitModule4("csmoothers", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
24085  #else
24086  __pyx_m = PyModule_Create(&__pyx_moduledef);
24087  #endif
24088  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
24089  #endif
24090  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
24091  Py_INCREF(__pyx_d);
24092  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
24093  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
24094  #if CYTHON_COMPILING_IN_PYPY
24095  Py_INCREF(__pyx_b);
24096  #endif
24097  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
24098  /*--- Initialize various global constants etc. ---*/
24099  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24100  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
24101  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24102  #endif
24103  if (__pyx_module_is_main_csmoothers) {
24104  if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24105  }
24106  #if PY_MAJOR_VERSION >= 3
24107  {
24108  PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
24109  if (!PyDict_GetItemString(modules, "csmoothers")) {
24110  if (unlikely(PyDict_SetItemString(modules, "csmoothers", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
24111  }
24112  }
24113  #endif
24114  /*--- Builtin init code ---*/
24115  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24116  /*--- Constants init code ---*/
24117  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24118  /*--- Global type/function init code ---*/
24119  (void)__Pyx_modinit_global_init_code();
24120  (void)__Pyx_modinit_variable_export_code();
24121  (void)__Pyx_modinit_function_export_code();
24122  if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
24123  if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error;
24124  (void)__Pyx_modinit_variable_import_code();
24125  (void)__Pyx_modinit_function_import_code();
24126  /*--- Execution code ---*/
24127  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
24128  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24129  #endif
24130 
24131  /* "csmoothers.pyx":1
24132  * import numpy as np # <<<<<<<<<<<<<<
24133  * import cython
24134  * cimport numpy as np
24135  */
24136  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
24137  __Pyx_GOTREF(__pyx_t_1);
24138  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24139  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24140 
24141  /* "csmoothers.pyx":5
24142  * cimport numpy as np
24143  *
24144  * class ASMFactor(object): # <<<<<<<<<<<<<<
24145  *
24146  * def __init__(self, L):
24147  */
24148  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__35); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error)
24149  __Pyx_GOTREF(__pyx_t_1);
24150  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__35, __pyx_n_s_ASMFactor, __pyx_n_s_ASMFactor, (PyObject *) NULL, __pyx_n_s_csmoothers, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error)
24151  __Pyx_GOTREF(__pyx_t_2);
24152 
24153  /* "csmoothers.pyx":7
24154  * class ASMFactor(object):
24155  *
24156  * def __init__(self, L): # <<<<<<<<<<<<<<
24157  * self.L = L
24158  * self._cASMFactor = cASMFactor(self.L._cSparseMatrix)
24159  */
24160  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10csmoothers_9ASMFactor_1__init__, 0, __pyx_n_s_ASMFactor___init, NULL, __pyx_n_s_csmoothers, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error)
24161  __Pyx_GOTREF(__pyx_t_3);
24162  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 7, __pyx_L1_error)
24163  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24164 
24165  /* "csmoothers.pyx":5
24166  * cimport numpy as np
24167  *
24168  * class ASMFactor(object): # <<<<<<<<<<<<<<
24169  *
24170  * def __init__(self, L):
24171  */
24172  __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ASMFactor, __pyx_tuple__35, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error)
24173  __Pyx_GOTREF(__pyx_t_3);
24174  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASMFactor, __pyx_t_3) < 0) __PYX_ERR(0, 5, __pyx_L1_error)
24175  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24176  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24177  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24178 
24179  /* "csmoothers.pyx":42
24180  *
24181  *
24182  * class BASMFactor(object): # <<<<<<<<<<<<<<
24183  *
24184  * def __init__(self, L, bs):
24185  */
24186  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__38); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error)
24187  __Pyx_GOTREF(__pyx_t_1);
24188  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__38, __pyx_n_s_BASMFactor, __pyx_n_s_BASMFactor, (PyObject *) NULL, __pyx_n_s_csmoothers, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
24189  __Pyx_GOTREF(__pyx_t_2);
24190 
24191  /* "csmoothers.pyx":44
24192  * class BASMFactor(object):
24193  *
24194  * def __init__(self, L, bs): # <<<<<<<<<<<<<<
24195  * self.L = L
24196  * self.bs = bs
24197  */
24198  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10csmoothers_10BASMFactor_1__init__, 0, __pyx_n_s_BASMFactor___init, NULL, __pyx_n_s_csmoothers, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error)
24199  __Pyx_GOTREF(__pyx_t_3);
24200  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 44, __pyx_L1_error)
24201  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24202 
24203  /* "csmoothers.pyx":42
24204  *
24205  *
24206  * class BASMFactor(object): # <<<<<<<<<<<<<<
24207  *
24208  * def __init__(self, L, bs):
24209  */
24210  __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_BASMFactor, __pyx_tuple__38, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error)
24211  __Pyx_GOTREF(__pyx_t_3);
24212  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BASMFactor, __pyx_t_3) < 0) __PYX_ERR(0, 42, __pyx_L1_error)
24213  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24214  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24215  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24216 
24217  /* "csmoothers.pyx":84
24218  * self.subdomain_col_pivots)
24219  *
24220  * def jacobi_NR_prepare(A, w, tol, M): # <<<<<<<<<<<<<<
24221  * """
24222  *
24223  */
24224  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_1jacobi_NR_prepare, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
24225  __Pyx_GOTREF(__pyx_t_1);
24226  if (PyDict_SetItem(__pyx_d, __pyx_n_s_jacobi_NR_prepare, __pyx_t_1) < 0) __PYX_ERR(0, 84, __pyx_L1_error)
24227  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24228 
24229  /* "csmoothers.pyx":109
24230  * cjacobi_NR_prepare(&AS, w, tol, &M[0])
24231  *
24232  * def jacobi_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
24233  * """
24234  *
24235  */
24236  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_3jacobi_NR_solve, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error)
24237  __Pyx_GOTREF(__pyx_t_1);
24238  if (PyDict_SetItem(__pyx_d, __pyx_n_s_jacobi_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 109, __pyx_L1_error)
24239  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24240 
24241  /* "csmoothers.pyx":136
24242  * cjacobi_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
24243  *
24244  * def nl_jacobi_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
24245  * """
24246  *
24247  */
24248  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_5nl_jacobi_NR_solve, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error)
24249  __Pyx_GOTREF(__pyx_t_1);
24250  if (PyDict_SetItem(__pyx_d, __pyx_n_s_nl_jacobi_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 136, __pyx_L1_error)
24251  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24252 
24253  /* "csmoothers.pyx":165
24254  * cnl_jacobi_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
24255  *
24256  * def gauss_seidel_NR_preare(A, w, tol, M): # <<<<<<<<<<<<<<
24257  * """
24258  *
24259  */
24260  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_7gauss_seidel_NR_preare, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error)
24261  __Pyx_GOTREF(__pyx_t_1);
24262  if (PyDict_SetItem(__pyx_d, __pyx_n_s_gauss_seidel_NR_preare, __pyx_t_1) < 0) __PYX_ERR(0, 165, __pyx_L1_error)
24263  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24264 
24265  /* "csmoothers.pyx":190
24266  * cgauss_seidel_NR_prepare(&AS, w, tol, &M[0])
24267  *
24268  * def gauss_seidel_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
24269  * """
24270  *
24271  */
24272  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_9gauss_seidel_NR_solve, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error)
24273  __Pyx_GOTREF(__pyx_t_1);
24274  if (PyDict_SetItem(__pyx_d, __pyx_n_s_gauss_seidel_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 190, __pyx_L1_error)
24275  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24276 
24277  /* "csmoothers.pyx":217
24278  * cgauss_seidel_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
24279  *
24280  * def nl_gauss_seidel_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
24281  * """
24282  *
24283  */
24284  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_11nl_gauss_seidel_NR_solve, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error)
24285  __Pyx_GOTREF(__pyx_t_1);
24286  if (PyDict_SetItem(__pyx_d, __pyx_n_s_nl_gauss_seidel_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 217, __pyx_L1_error)
24287  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24288 
24289  /* "csmoothers.pyx":251
24290  * cnl_gauss_seidel_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
24291  *
24292  * def asm_NR_prepare(A, asmFactor): # <<<<<<<<<<<<<<
24293  * """
24294  *
24295  */
24296  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_13asm_NR_prepare, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 251, __pyx_L1_error)
24297  __Pyx_GOTREF(__pyx_t_1);
24298  if (PyDict_SetItem(__pyx_d, __pyx_n_s_asm_NR_prepare, __pyx_t_1) < 0) __PYX_ERR(0, 251, __pyx_L1_error)
24299  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24300 
24301  /* "csmoothers.pyx":277
24302  * asmFactor.subdomain_pivots)
24303  *
24304  * def asm_NR_solve(A, w, asmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
24305  * """
24306  *
24307  */
24308  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_15asm_NR_solve, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error)
24309  __Pyx_GOTREF(__pyx_t_1);
24310  if (PyDict_SetItem(__pyx_d, __pyx_n_s_asm_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 277, __pyx_L1_error)
24311  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24312 
24313  /* "csmoothers.pyx":321
24314  * asmFactor.subdomain_pivots)
24315  *
24316  * def basm_NR_prepare(A, basmFactor): # <<<<<<<<<<<<<<
24317  * """
24318  *
24319  */
24320  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_17basm_NR_prepare, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 321, __pyx_L1_error)
24321  __Pyx_GOTREF(__pyx_t_1);
24322  if (PyDict_SetItem(__pyx_d, __pyx_n_s_basm_NR_prepare, __pyx_t_1) < 0) __PYX_ERR(0, 321, __pyx_L1_error)
24323  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24324 
24325  /* "csmoothers.pyx":350
24326  *
24327  *
24328  * def basm_NR_solve(A, w, basmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
24329  * """
24330  *
24331  */
24332  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_19basm_NR_solve, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 350, __pyx_L1_error)
24333  __Pyx_GOTREF(__pyx_t_1);
24334  if (PyDict_SetItem(__pyx_d, __pyx_n_s_basm_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 350, __pyx_L1_error)
24335  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24336 
24337  /* "csmoothers.pyx":1
24338  * import numpy as np # <<<<<<<<<<<<<<
24339  * import cython
24340  * cimport numpy as np
24341  */
24342  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
24343  __Pyx_GOTREF(__pyx_t_1);
24344  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24345  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24346 
24347  /* "View.MemoryView":208
24348  * info.obj = self
24349  *
24350  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
24351  *
24352  * def __dealloc__(array self):
24353  */
24354  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 208, __pyx_L1_error)
24355  __Pyx_GOTREF(__pyx_t_1);
24356  if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 208, __pyx_L1_error)
24357  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24358  PyType_Modified(__pyx_array_type);
24359 
24360  /* "View.MemoryView":285
24361  * return self.name
24362  *
24363  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
24364  * cdef strided = Enum("<strided and direct>") # default
24365  * cdef indirect = Enum("<strided and indirect>")
24366  */
24367  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 285, __pyx_L1_error)
24368  __Pyx_GOTREF(__pyx_t_1);
24369  __Pyx_XGOTREF(generic);
24370  __Pyx_DECREF_SET(generic, __pyx_t_1);
24371  __Pyx_GIVEREF(__pyx_t_1);
24372  __pyx_t_1 = 0;
24373 
24374  /* "View.MemoryView":286
24375  *
24376  * cdef generic = Enum("<strided and direct or indirect>")
24377  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
24378  * cdef indirect = Enum("<strided and indirect>")
24379  *
24380  */
24381  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 286, __pyx_L1_error)
24382  __Pyx_GOTREF(__pyx_t_1);
24383  __Pyx_XGOTREF(strided);
24384  __Pyx_DECREF_SET(strided, __pyx_t_1);
24385  __Pyx_GIVEREF(__pyx_t_1);
24386  __pyx_t_1 = 0;
24387 
24388  /* "View.MemoryView":287
24389  * cdef generic = Enum("<strided and direct or indirect>")
24390  * cdef strided = Enum("<strided and direct>") # default
24391  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
24392  *
24393  *
24394  */
24395  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __pyx_L1_error)
24396  __Pyx_GOTREF(__pyx_t_1);
24397  __Pyx_XGOTREF(indirect);
24398  __Pyx_DECREF_SET(indirect, __pyx_t_1);
24399  __Pyx_GIVEREF(__pyx_t_1);
24400  __pyx_t_1 = 0;
24401 
24402  /* "View.MemoryView":290
24403  *
24404  *
24405  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
24406  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
24407  *
24408  */
24409  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 290, __pyx_L1_error)
24410  __Pyx_GOTREF(__pyx_t_1);
24411  __Pyx_XGOTREF(contiguous);
24412  __Pyx_DECREF_SET(contiguous, __pyx_t_1);
24413  __Pyx_GIVEREF(__pyx_t_1);
24414  __pyx_t_1 = 0;
24415 
24416  /* "View.MemoryView":291
24417  *
24418  * cdef contiguous = Enum("<contiguous and direct>")
24419  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
24420  *
24421  *
24422  */
24423  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 291, __pyx_L1_error)
24424  __Pyx_GOTREF(__pyx_t_1);
24425  __Pyx_XGOTREF(indirect_contiguous);
24426  __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
24427  __Pyx_GIVEREF(__pyx_t_1);
24428  __pyx_t_1 = 0;
24429 
24430  /* "View.MemoryView":315
24431  *
24432  * DEF THREAD_LOCKS_PREALLOCATED = 8
24433  * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
24434  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
24435  * PyThread_allocate_lock(),
24436  */
24437  __pyx_memoryview_thread_locks_used = 0;
24438 
24439  /* "View.MemoryView":316
24440  * DEF THREAD_LOCKS_PREALLOCATED = 8
24441  * cdef int __pyx_memoryview_thread_locks_used = 0
24442  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
24443  * PyThread_allocate_lock(),
24444  * PyThread_allocate_lock(),
24445  */
24446  __pyx_t_4[0] = PyThread_allocate_lock();
24447  __pyx_t_4[1] = PyThread_allocate_lock();
24448  __pyx_t_4[2] = PyThread_allocate_lock();
24449  __pyx_t_4[3] = PyThread_allocate_lock();
24450  __pyx_t_4[4] = PyThread_allocate_lock();
24451  __pyx_t_4[5] = PyThread_allocate_lock();
24452  __pyx_t_4[6] = PyThread_allocate_lock();
24453  __pyx_t_4[7] = PyThread_allocate_lock();
24454  memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_4, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
24455 
24456  /* "View.MemoryView":544
24457  * info.obj = self
24458  *
24459  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
24460  *
24461  *
24462  */
24463  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 544, __pyx_L1_error)
24464  __Pyx_GOTREF(__pyx_t_1);
24465  if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 544, __pyx_L1_error)
24466  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24467  PyType_Modified(__pyx_memoryview_type);
24468 
24469  /* "View.MemoryView":990
24470  * return self.from_object
24471  *
24472  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
24473  *
24474  *
24475  */
24476  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 990, __pyx_L1_error)
24477  __Pyx_GOTREF(__pyx_t_1);
24478  if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 990, __pyx_L1_error)
24479  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24480  PyType_Modified(__pyx_memoryviewslice_type);
24481 
24482  /* "(tree fragment)":1
24483  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
24484  * if __pyx_checksum != 0xb068931:
24485  * from pickle import PickleError as __pyx_PickleError
24486  */
24487  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
24488  __Pyx_GOTREF(__pyx_t_1);
24489  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
24490  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24491 
24492  /* "(tree fragment)":9
24493  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
24494  * return __pyx_result
24495  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
24496  * __pyx_result.name = __pyx_state[0]
24497  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
24498  */
24499 
24500  /*--- Wrapped vars code ---*/
24501 
24502  goto __pyx_L0;
24503  __pyx_L1_error:;
24504  __Pyx_XDECREF(__pyx_t_1);
24505  __Pyx_XDECREF(__pyx_t_2);
24506  __Pyx_XDECREF(__pyx_t_3);
24507  if (__pyx_m) {
24508  if (__pyx_d) {
24509  __Pyx_AddTraceback("init csmoothers", 0, __pyx_lineno, __pyx_filename);
24510  }
24511  Py_DECREF(__pyx_m); __pyx_m = 0;
24512  } else if (!PyErr_Occurred()) {
24513  PyErr_SetString(PyExc_ImportError, "init csmoothers");
24514  }
24515  __pyx_L0:;
24516  __Pyx_RefNannyFinishContext();
24517  #if CYTHON_PEP489_MULTI_PHASE_INIT
24518  return (__pyx_m != NULL) ? 0 : -1;
24519  #elif PY_MAJOR_VERSION >= 3
24520  return __pyx_m;
24521  #else
24522  return;
24523  #endif
24524 }
24525 
24526 /* --- Runtime support code --- */
24527 /* Refnanny */
24528 #if CYTHON_REFNANNY
24529 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
24530  PyObject *m = NULL, *p = NULL;
24531  void *r = NULL;
24532  m = PyImport_ImportModule((char *)modname);
24533  if (!m) goto end;
24534  p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
24535  if (!p) goto end;
24536  r = PyLong_AsVoidPtr(p);
24537 end:
24538  Py_XDECREF(p);
24539  Py_XDECREF(m);
24540  return (__Pyx_RefNannyAPIStruct *)r;
24541 }
24542 #endif
24543 
24544 /* PyObjectGetAttrStr */
24545 #if CYTHON_USE_TYPE_SLOTS
24546 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
24547  PyTypeObject* tp = Py_TYPE(obj);
24548  if (likely(tp->tp_getattro))
24549  return tp->tp_getattro(obj, attr_name);
24550 #if PY_MAJOR_VERSION < 3
24551  if (likely(tp->tp_getattr))
24552  return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
24553 #endif
24554  return PyObject_GetAttr(obj, attr_name);
24555 }
24556 #endif
24557 
24558 /* GetBuiltinName */
24559 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
24560  PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
24561  if (unlikely(!result)) {
24562  PyErr_Format(PyExc_NameError,
24563 #if PY_MAJOR_VERSION >= 3
24564  "name '%U' is not defined", name);
24565 #else
24566  "name '%.200s' is not defined", PyString_AS_STRING(name));
24567 #endif
24568  }
24569  return result;
24570 }
24571 
24572 /* RaiseArgTupleInvalid */
24573 static void __Pyx_RaiseArgtupleInvalid(
24574  const char* func_name,
24575  int exact,
24576  Py_ssize_t num_min,
24577  Py_ssize_t num_max,
24578  Py_ssize_t num_found)
24579 {
24580  Py_ssize_t num_expected;
24581  const char *more_or_less;
24582  if (num_found < num_min) {
24583  num_expected = num_min;
24584  more_or_less = "at least";
24585  } else {
24586  num_expected = num_max;
24587  more_or_less = "at most";
24588  }
24589  if (exact) {
24590  more_or_less = "exactly";
24591  }
24592  PyErr_Format(PyExc_TypeError,
24593  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
24594  func_name, more_or_less, num_expected,
24595  (num_expected == 1) ? "" : "s", num_found);
24596 }
24597 
24598 /* RaiseDoubleKeywords */
24599 static void __Pyx_RaiseDoubleKeywordsError(
24600  const char* func_name,
24601  PyObject* kw_name)
24602 {
24603  PyErr_Format(PyExc_TypeError,
24604  #if PY_MAJOR_VERSION >= 3
24605  "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
24606  #else
24607  "%s() got multiple values for keyword argument '%s'", func_name,
24608  PyString_AsString(kw_name));
24609  #endif
24610 }
24611 
24612 /* ParseKeywords */
24613 static int __Pyx_ParseOptionalKeywords(
24614  PyObject *kwds,
24615  PyObject **argnames[],
24616  PyObject *kwds2,
24617  PyObject *values[],
24618  Py_ssize_t num_pos_args,
24619  const char* function_name)
24620 {
24621  PyObject *key = 0, *value = 0;
24622  Py_ssize_t pos = 0;
24623  PyObject*** name;
24624  PyObject*** first_kw_arg = argnames + num_pos_args;
24625  while (PyDict_Next(kwds, &pos, &key, &value)) {
24626  name = first_kw_arg;
24627  while (*name && (**name != key)) name++;
24628  if (*name) {
24629  values[name-argnames] = value;
24630  continue;
24631  }
24632  name = first_kw_arg;
24633  #if PY_MAJOR_VERSION < 3
24634  if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
24635  while (*name) {
24636  if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
24637  && _PyString_Eq(**name, key)) {
24638  values[name-argnames] = value;
24639  break;
24640  }
24641  name++;
24642  }
24643  if (*name) continue;
24644  else {
24645  PyObject*** argname = argnames;
24646  while (argname != first_kw_arg) {
24647  if ((**argname == key) || (
24648  (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
24649  && _PyString_Eq(**argname, key))) {
24650  goto arg_passed_twice;
24651  }
24652  argname++;
24653  }
24654  }
24655  } else
24656  #endif
24657  if (likely(PyUnicode_Check(key))) {
24658  while (*name) {
24659  int cmp = (**name == key) ? 0 :
24660  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
24661  (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
24662  #endif
24663  PyUnicode_Compare(**name, key);
24664  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
24665  if (cmp == 0) {
24666  values[name-argnames] = value;
24667  break;
24668  }
24669  name++;
24670  }
24671  if (*name) continue;
24672  else {
24673  PyObject*** argname = argnames;
24674  while (argname != first_kw_arg) {
24675  int cmp = (**argname == key) ? 0 :
24676  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
24677  (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
24678  #endif
24679  PyUnicode_Compare(**argname, key);
24680  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
24681  if (cmp == 0) goto arg_passed_twice;
24682  argname++;
24683  }
24684  }
24685  } else
24686  goto invalid_keyword_type;
24687  if (kwds2) {
24688  if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
24689  } else {
24690  goto invalid_keyword;
24691  }
24692  }
24693  return 0;
24694 arg_passed_twice:
24695  __Pyx_RaiseDoubleKeywordsError(function_name, key);
24696  goto bad;
24697 invalid_keyword_type:
24698  PyErr_Format(PyExc_TypeError,
24699  "%.200s() keywords must be strings", function_name);
24700  goto bad;
24701 invalid_keyword:
24702  PyErr_Format(PyExc_TypeError,
24703  #if PY_MAJOR_VERSION < 3
24704  "%.200s() got an unexpected keyword argument '%.200s'",
24705  function_name, PyString_AsString(key));
24706  #else
24707  "%s() got an unexpected keyword argument '%U'",
24708  function_name, key);
24709  #endif
24710 bad:
24711  return -1;
24712 }
24713 
24714 /* PyObjectSetAttrStr */
24715 #if CYTHON_USE_TYPE_SLOTS
24716 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
24717  PyTypeObject* tp = Py_TYPE(obj);
24718  if (likely(tp->tp_setattro))
24719  return tp->tp_setattro(obj, attr_name, value);
24720 #if PY_MAJOR_VERSION < 3
24721  if (likely(tp->tp_setattr))
24722  return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
24723 #endif
24724  return PyObject_SetAttr(obj, attr_name, value);
24725 }
24726 #endif
24727 
24728 /* PyCFunctionFastCall */
24729 #if CYTHON_FAST_PYCCALL
24730 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
24731  PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
24732  PyCFunction meth = PyCFunction_GET_FUNCTION(func);
24733  PyObject *self = PyCFunction_GET_SELF(func);
24734  int flags = PyCFunction_GET_FLAGS(func);
24735  assert(PyCFunction_Check(func));
24736  assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)));
24737  assert(nargs >= 0);
24738  assert(nargs == 0 || args != NULL);
24739  /* _PyCFunction_FastCallDict() must not be called with an exception set,
24740  because it may clear it (directly or indirectly) and so the
24741  caller loses its exception */
24742  assert(!PyErr_Occurred());
24743  if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
24744  return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (self, args, nargs, NULL);
24745  } else {
24746  return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs);
24747  }
24748 }
24749 #endif
24750 
24751 /* PyFunctionFastCall */
24752 #if CYTHON_FAST_PYCALL
24753 #include "frameobject.h"
24754 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
24755  PyObject *globals) {
24756  PyFrameObject *f;
24757  PyThreadState *tstate = __Pyx_PyThreadState_Current;
24758  PyObject **fastlocals;
24759  Py_ssize_t i;
24760  PyObject *result;
24761  assert(globals != NULL);
24762  /* XXX Perhaps we should create a specialized
24763  PyFrame_New() that doesn't take locals, but does
24764  take builtins without sanity checking them.
24765  */
24766  assert(tstate != NULL);
24767  f = PyFrame_New(tstate, co, globals, NULL);
24768  if (f == NULL) {
24769  return NULL;
24770  }
24771  fastlocals = f->f_localsplus;
24772  for (i = 0; i < na; i++) {
24773  Py_INCREF(*args);
24774  fastlocals[i] = *args++;
24775  }
24776  result = PyEval_EvalFrameEx(f,0);
24777  ++tstate->recursion_depth;
24778  Py_DECREF(f);
24779  --tstate->recursion_depth;
24780  return result;
24781 }
24782 #if 1 || PY_VERSION_HEX < 0x030600B1
24783 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
24784  PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
24785  PyObject *globals = PyFunction_GET_GLOBALS(func);
24786  PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
24787  PyObject *closure;
24788 #if PY_MAJOR_VERSION >= 3
24789  PyObject *kwdefs;
24790 #endif
24791  PyObject *kwtuple, **k;
24792  PyObject **d;
24793  Py_ssize_t nd;
24794  Py_ssize_t nk;
24795  PyObject *result;
24796  assert(kwargs == NULL || PyDict_Check(kwargs));
24797  nk = kwargs ? PyDict_Size(kwargs) : 0;
24798  if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
24799  return NULL;
24800  }
24801  if (
24802 #if PY_MAJOR_VERSION >= 3
24803  co->co_kwonlyargcount == 0 &&
24804 #endif
24805  likely(kwargs == NULL || nk == 0) &&
24806  co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
24807  if (argdefs == NULL && co->co_argcount == nargs) {
24808  result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
24809  goto done;
24810  }
24811  else if (nargs == 0 && argdefs != NULL
24812  && co->co_argcount == Py_SIZE(argdefs)) {
24813  /* function called with no arguments, but all parameters have
24814  a default value: use default values as arguments .*/
24815  args = &PyTuple_GET_ITEM(argdefs, 0);
24816  result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
24817  goto done;
24818  }
24819  }
24820  if (kwargs != NULL) {
24821  Py_ssize_t pos, i;
24822  kwtuple = PyTuple_New(2 * nk);
24823  if (kwtuple == NULL) {
24824  result = NULL;
24825  goto done;
24826  }
24827  k = &PyTuple_GET_ITEM(kwtuple, 0);
24828  pos = i = 0;
24829  while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
24830  Py_INCREF(k[i]);
24831  Py_INCREF(k[i+1]);
24832  i += 2;
24833  }
24834  nk = i / 2;
24835  }
24836  else {
24837  kwtuple = NULL;
24838  k = NULL;
24839  }
24840  closure = PyFunction_GET_CLOSURE(func);
24841 #if PY_MAJOR_VERSION >= 3
24842  kwdefs = PyFunction_GET_KW_DEFAULTS(func);
24843 #endif
24844  if (argdefs != NULL) {
24845  d = &PyTuple_GET_ITEM(argdefs, 0);
24846  nd = Py_SIZE(argdefs);
24847  }
24848  else {
24849  d = NULL;
24850  nd = 0;
24851  }
24852 #if PY_MAJOR_VERSION >= 3
24853  result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
24854  args, nargs,
24855  k, (int)nk,
24856  d, (int)nd, kwdefs, closure);
24857 #else
24858  result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
24859  args, nargs,
24860  k, (int)nk,
24861  d, (int)nd, closure);
24862 #endif
24863  Py_XDECREF(kwtuple);
24864 done:
24865  Py_LeaveRecursiveCall();
24866  return result;
24867 }
24868 #endif
24869 #endif
24870 
24871 /* PyObjectCall */
24872 #if CYTHON_COMPILING_IN_CPYTHON
24873 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
24874  PyObject *result;
24875  ternaryfunc call = func->ob_type->tp_call;
24876  if (unlikely(!call))
24877  return PyObject_Call(func, arg, kw);
24878  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
24879  return NULL;
24880  result = (*call)(func, arg, kw);
24881  Py_LeaveRecursiveCall();
24882  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24883  PyErr_SetString(
24884  PyExc_SystemError,
24885  "NULL result without error in PyObject_Call");
24886  }
24887  return result;
24888 }
24889 #endif
24890 
24891 /* PyObjectCallMethO */
24892 #if CYTHON_COMPILING_IN_CPYTHON
24893 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
24894  PyObject *self, *result;
24895  PyCFunction cfunc;
24896  cfunc = PyCFunction_GET_FUNCTION(func);
24897  self = PyCFunction_GET_SELF(func);
24898  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
24899  return NULL;
24900  result = cfunc(self, arg);
24901  Py_LeaveRecursiveCall();
24902  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24903  PyErr_SetString(
24904  PyExc_SystemError,
24905  "NULL result without error in PyObject_Call");
24906  }
24907  return result;
24908 }
24909 #endif
24910 
24911 /* PyObjectCallOneArg */
24912 #if CYTHON_COMPILING_IN_CPYTHON
24913 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24914  PyObject *result;
24915  PyObject *args = PyTuple_New(1);
24916  if (unlikely(!args)) return NULL;
24917  Py_INCREF(arg);
24918  PyTuple_SET_ITEM(args, 0, arg);
24919  result = __Pyx_PyObject_Call(func, args, NULL);
24920  Py_DECREF(args);
24921  return result;
24922 }
24923 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24924 #if CYTHON_FAST_PYCALL
24925  if (PyFunction_Check(func)) {
24926  return __Pyx_PyFunction_FastCall(func, &arg, 1);
24927  }
24928 #endif
24929  if (likely(PyCFunction_Check(func))) {
24930  if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
24931  return __Pyx_PyObject_CallMethO(func, arg);
24932 #if CYTHON_FAST_PYCCALL
24933  } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
24934  return __Pyx_PyCFunction_FastCall(func, &arg, 1);
24935 #endif
24936  }
24937  }
24938  return __Pyx__PyObject_CallOneArg(func, arg);
24939 }
24940 #else
24941 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24942  PyObject *result;
24943  PyObject *args = PyTuple_Pack(1, arg);
24944  if (unlikely(!args)) return NULL;
24945  result = __Pyx_PyObject_Call(func, args, NULL);
24946  Py_DECREF(args);
24947  return result;
24948 }
24949 #endif
24950 
24951 /* ArgTypeTest */
24952 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
24953 {
24954  if (unlikely(!type)) {
24955  PyErr_SetString(PyExc_SystemError, "Missing type object");
24956  return 0;
24957  }
24958  else if (exact) {
24959  #if PY_MAJOR_VERSION == 2
24960  if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
24961  #endif
24962  }
24963  else {
24964  if (likely(__Pyx_TypeCheck(obj, type))) return 1;
24965  }
24966  PyErr_Format(PyExc_TypeError,
24967  "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
24968  name, type->tp_name, Py_TYPE(obj)->tp_name);
24969  return 0;
24970 }
24971 
24972 /* PyErrFetchRestore */
24973 #if CYTHON_FAST_THREAD_STATE
24974 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24975  PyObject *tmp_type, *tmp_value, *tmp_tb;
24976  tmp_type = tstate->curexc_type;
24977  tmp_value = tstate->curexc_value;
24978  tmp_tb = tstate->curexc_traceback;
24979  tstate->curexc_type = type;
24980  tstate->curexc_value = value;
24981  tstate->curexc_traceback = tb;
24982  Py_XDECREF(tmp_type);
24983  Py_XDECREF(tmp_value);
24984  Py_XDECREF(tmp_tb);
24985 }
24986 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24987  *type = tstate->curexc_type;
24988  *value = tstate->curexc_value;
24989  *tb = tstate->curexc_traceback;
24990  tstate->curexc_type = 0;
24991  tstate->curexc_value = 0;
24992  tstate->curexc_traceback = 0;
24993 }
24994 #endif
24995 
24996 /* RaiseException */
24997 #if PY_MAJOR_VERSION < 3
24998 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
24999  CYTHON_UNUSED PyObject *cause) {
25000  __Pyx_PyThreadState_declare
25001  Py_XINCREF(type);
25002  if (!value || value == Py_None)
25003  value = NULL;
25004  else
25005  Py_INCREF(value);
25006  if (!tb || tb == Py_None)
25007  tb = NULL;
25008  else {
25009  Py_INCREF(tb);
25010  if (!PyTraceBack_Check(tb)) {
25011  PyErr_SetString(PyExc_TypeError,
25012  "raise: arg 3 must be a traceback or None");
25013  goto raise_error;
25014  }
25015  }
25016  if (PyType_Check(type)) {
25017 #if CYTHON_COMPILING_IN_PYPY
25018  if (!value) {
25019  Py_INCREF(Py_None);
25020  value = Py_None;
25021  }
25022 #endif
25023  PyErr_NormalizeException(&type, &value, &tb);
25024  } else {
25025  if (value) {
25026  PyErr_SetString(PyExc_TypeError,
25027  "instance exception may not have a separate value");
25028  goto raise_error;
25029  }
25030  value = type;
25031  type = (PyObject*) Py_TYPE(type);
25032  Py_INCREF(type);
25033  if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
25034  PyErr_SetString(PyExc_TypeError,
25035  "raise: exception class must be a subclass of BaseException");
25036  goto raise_error;
25037  }
25038  }
25039  __Pyx_PyThreadState_assign
25040  __Pyx_ErrRestore(type, value, tb);
25041  return;
25042 raise_error:
25043  Py_XDECREF(value);
25044  Py_XDECREF(type);
25045  Py_XDECREF(tb);
25046  return;
25047 }
25048 #else
25049 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
25050  PyObject* owned_instance = NULL;
25051  if (tb == Py_None) {
25052  tb = 0;
25053  } else if (tb && !PyTraceBack_Check(tb)) {
25054  PyErr_SetString(PyExc_TypeError,
25055  "raise: arg 3 must be a traceback or None");
25056  goto bad;
25057  }
25058  if (value == Py_None)
25059  value = 0;
25060  if (PyExceptionInstance_Check(type)) {
25061  if (value) {
25062  PyErr_SetString(PyExc_TypeError,
25063  "instance exception may not have a separate value");
25064  goto bad;
25065  }
25066  value = type;
25067  type = (PyObject*) Py_TYPE(value);
25068  } else if (PyExceptionClass_Check(type)) {
25069  PyObject *instance_class = NULL;
25070  if (value && PyExceptionInstance_Check(value)) {
25071  instance_class = (PyObject*) Py_TYPE(value);
25072  if (instance_class != type) {
25073  int is_subclass = PyObject_IsSubclass(instance_class, type);
25074  if (!is_subclass) {
25075  instance_class = NULL;
25076  } else if (unlikely(is_subclass == -1)) {
25077  goto bad;
25078  } else {
25079  type = instance_class;
25080  }
25081  }
25082  }
25083  if (!instance_class) {
25084  PyObject *args;
25085  if (!value)
25086  args = PyTuple_New(0);
25087  else if (PyTuple_Check(value)) {
25088  Py_INCREF(value);
25089  args = value;
25090  } else
25091  args = PyTuple_Pack(1, value);
25092  if (!args)
25093  goto bad;
25094  owned_instance = PyObject_Call(type, args, NULL);
25095  Py_DECREF(args);
25096  if (!owned_instance)
25097  goto bad;
25098  value = owned_instance;
25099  if (!PyExceptionInstance_Check(value)) {
25100  PyErr_Format(PyExc_TypeError,
25101  "calling %R should have returned an instance of "
25102  "BaseException, not %R",
25103  type, Py_TYPE(value));
25104  goto bad;
25105  }
25106  }
25107  } else {
25108  PyErr_SetString(PyExc_TypeError,
25109  "raise: exception class must be a subclass of BaseException");
25110  goto bad;
25111  }
25112  if (cause) {
25113  PyObject *fixed_cause;
25114  if (cause == Py_None) {
25115  fixed_cause = NULL;
25116  } else if (PyExceptionClass_Check(cause)) {
25117  fixed_cause = PyObject_CallObject(cause, NULL);
25118  if (fixed_cause == NULL)
25119  goto bad;
25120  } else if (PyExceptionInstance_Check(cause)) {
25121  fixed_cause = cause;
25122  Py_INCREF(fixed_cause);
25123  } else {
25124  PyErr_SetString(PyExc_TypeError,
25125  "exception causes must derive from "
25126  "BaseException");
25127  goto bad;
25128  }
25129  PyException_SetCause(value, fixed_cause);
25130  }
25131  PyErr_SetObject(type, value);
25132  if (tb) {
25133 #if CYTHON_COMPILING_IN_PYPY
25134  PyObject *tmp_type, *tmp_value, *tmp_tb;
25135  PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
25136  Py_INCREF(tb);
25137  PyErr_Restore(tmp_type, tmp_value, tb);
25138  Py_XDECREF(tmp_tb);
25139 #else
25140  PyThreadState *tstate = __Pyx_PyThreadState_Current;
25141  PyObject* tmp_tb = tstate->curexc_traceback;
25142  if (tb != tmp_tb) {
25143  Py_INCREF(tb);
25144  tstate->curexc_traceback = tb;
25145  Py_XDECREF(tmp_tb);
25146  }
25147 #endif
25148  }
25149 bad:
25150  Py_XDECREF(owned_instance);
25151  return;
25152 }
25153 #endif
25154 
25155 /* ExtTypeTest */
25156 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
25157  if (unlikely(!type)) {
25158  PyErr_SetString(PyExc_SystemError, "Missing type object");
25159  return 0;
25160  }
25161  if (likely(__Pyx_TypeCheck(obj, type)))
25162  return 1;
25163  PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
25164  Py_TYPE(obj)->tp_name, type->tp_name);
25165  return 0;
25166 }
25167 
25168 /* MemviewSliceInit */
25169 static int
25170 __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
25171  int ndim,
25172  __Pyx_memviewslice *memviewslice,
25173  int memview_is_new_reference)
25174 {
25175  __Pyx_RefNannyDeclarations
25176  int i, retval=-1;
25177  Py_buffer *buf = &memview->view;
25178  __Pyx_RefNannySetupContext("init_memviewslice", 0);
25179  if (!buf) {
25180  PyErr_SetString(PyExc_ValueError,
25181  "buf is NULL.");
25182  goto fail;
25183  } else if (memviewslice->memview || memviewslice->data) {
25184  PyErr_SetString(PyExc_ValueError,
25185  "memviewslice is already initialized!");
25186  goto fail;
25187  }
25188  if (buf->strides) {
25189  for (i = 0; i < ndim; i++) {
25190  memviewslice->strides[i] = buf->strides[i];
25191  }
25192  } else {
25193  Py_ssize_t stride = buf->itemsize;
25194  for (i = ndim - 1; i >= 0; i--) {
25195  memviewslice->strides[i] = stride;
25196  stride *= buf->shape[i];
25197  }
25198  }
25199  for (i = 0; i < ndim; i++) {
25200  memviewslice->shape[i] = buf->shape[i];
25201  if (buf->suboffsets) {
25202  memviewslice->suboffsets[i] = buf->suboffsets[i];
25203  } else {
25204  memviewslice->suboffsets[i] = -1;
25205  }
25206  }
25207  memviewslice->memview = memview;
25208  memviewslice->data = (char *)buf->buf;
25209  if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
25210  Py_INCREF(memview);
25211  }
25212  retval = 0;
25213  goto no_fail;
25214 fail:
25215  memviewslice->memview = 0;
25216  memviewslice->data = 0;
25217  retval = -1;
25218 no_fail:
25219  __Pyx_RefNannyFinishContext();
25220  return retval;
25221 }
25222 #ifndef Py_NO_RETURN
25223 #define Py_NO_RETURN
25224 #endif
25225 static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
25226  va_list vargs;
25227  char msg[200];
25228 #ifdef HAVE_STDARG_PROTOTYPES
25229  va_start(vargs, fmt);
25230 #else
25231  va_start(vargs);
25232 #endif
25233  vsnprintf(msg, 200, fmt, vargs);
25234  va_end(vargs);
25235  Py_FatalError(msg);
25236 }
25237 static CYTHON_INLINE int
25238 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
25239  PyThread_type_lock lock)
25240 {
25241  int result;
25242  PyThread_acquire_lock(lock, 1);
25243  result = (*acquisition_count)++;
25244  PyThread_release_lock(lock);
25245  return result;
25246 }
25247 static CYTHON_INLINE int
25248 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
25249  PyThread_type_lock lock)
25250 {
25251  int result;
25252  PyThread_acquire_lock(lock, 1);
25253  result = (*acquisition_count)--;
25254  PyThread_release_lock(lock);
25255  return result;
25256 }
25257 static CYTHON_INLINE void
25258 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
25259 {
25260  int first_time;
25261  struct __pyx_memoryview_obj *memview = memslice->memview;
25262  if (!memview || (PyObject *) memview == Py_None)
25263  return;
25264  if (__pyx_get_slice_count(memview) < 0)
25265  __pyx_fatalerror("Acquisition count is %d (line %d)",
25266  __pyx_get_slice_count(memview), lineno);
25267  first_time = __pyx_add_acquisition_count(memview) == 0;
25268  if (first_time) {
25269  if (have_gil) {
25270  Py_INCREF((PyObject *) memview);
25271  } else {
25272  PyGILState_STATE _gilstate = PyGILState_Ensure();
25273  Py_INCREF((PyObject *) memview);
25274  PyGILState_Release(_gilstate);
25275  }
25276  }
25277 }
25278 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
25279  int have_gil, int lineno) {
25280  int last_time;
25281  struct __pyx_memoryview_obj *memview = memslice->memview;
25282  if (!memview ) {
25283  return;
25284  } else if ((PyObject *) memview == Py_None) {
25285  memslice->memview = NULL;
25286  return;
25287  }
25288  if (__pyx_get_slice_count(memview) <= 0)
25289  __pyx_fatalerror("Acquisition count is %d (line %d)",
25290  __pyx_get_slice_count(memview), lineno);
25291  last_time = __pyx_sub_acquisition_count(memview) == 1;
25292  memslice->data = NULL;
25293  if (last_time) {
25294  if (have_gil) {
25295  Py_CLEAR(memslice->memview);
25296  } else {
25297  PyGILState_STATE _gilstate = PyGILState_Ensure();
25298  Py_CLEAR(memslice->memview);
25299  PyGILState_Release(_gilstate);
25300  }
25301  } else {
25302  memslice->memview = NULL;
25303  }
25304 }
25305 
25306 /* BufferIndexError */
25307 static void __Pyx_RaiseBufferIndexError(int axis) {
25308  PyErr_Format(PyExc_IndexError,
25309  "Out of bounds on buffer access (axis %d)", axis);
25310 }
25311 
25312 /* WriteUnraisableException */
25313 static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
25314  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
25315  int full_traceback, CYTHON_UNUSED int nogil) {
25316  PyObject *old_exc, *old_val, *old_tb;
25317  PyObject *ctx;
25318  __Pyx_PyThreadState_declare
25319 #ifdef WITH_THREAD
25320  PyGILState_STATE state;
25321  if (nogil)
25322  state = PyGILState_Ensure();
25323 #ifdef _MSC_VER
25324  else state = (PyGILState_STATE)-1;
25325 #endif
25326 #endif
25327  __Pyx_PyThreadState_assign
25328  __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
25329  if (full_traceback) {
25330  Py_XINCREF(old_exc);
25331  Py_XINCREF(old_val);
25332  Py_XINCREF(old_tb);
25333  __Pyx_ErrRestore(old_exc, old_val, old_tb);
25334  PyErr_PrintEx(1);
25335  }
25336  #if PY_MAJOR_VERSION < 3
25337  ctx = PyString_FromString(name);
25338  #else
25339  ctx = PyUnicode_FromString(name);
25340  #endif
25341  __Pyx_ErrRestore(old_exc, old_val, old_tb);
25342  if (!ctx) {
25343  PyErr_WriteUnraisable(Py_None);
25344  } else {
25345  PyErr_WriteUnraisable(ctx);
25346  Py_DECREF(ctx);
25347  }
25348 #ifdef WITH_THREAD
25349  if (nogil)
25350  PyGILState_Release(state);
25351 #endif
25352 }
25353 
25354 /* DictGetItem */
25355 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
25356 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
25357  PyObject *value;
25358  value = PyDict_GetItemWithError(d, key);
25359  if (unlikely(!value)) {
25360  if (!PyErr_Occurred()) {
25361  PyObject* args = PyTuple_Pack(1, key);
25362  if (likely(args))
25363  PyErr_SetObject(PyExc_KeyError, args);
25364  Py_XDECREF(args);
25365  }
25366  return NULL;
25367  }
25368  Py_INCREF(value);
25369  return value;
25370 }
25371 #endif
25372 
25373 /* RaiseTooManyValuesToUnpack */
25374 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
25375  PyErr_Format(PyExc_ValueError,
25376  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
25377 }
25378 
25379 /* RaiseNeedMoreValuesToUnpack */
25380 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
25381  PyErr_Format(PyExc_ValueError,
25382  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
25383  index, (index == 1) ? "" : "s");
25384 }
25385 
25386 /* RaiseNoneIterError */
25387 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
25388  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
25389 }
25390 
25391 /* SaveResetException */
25392 #if CYTHON_FAST_THREAD_STATE
25393 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25394  #if PY_VERSION_HEX >= 0x030700A3
25395  *type = tstate->exc_state.exc_type;
25396  *value = tstate->exc_state.exc_value;
25397  *tb = tstate->exc_state.exc_traceback;
25398  #else
25399  *type = tstate->exc_type;
25400  *value = tstate->exc_value;
25401  *tb = tstate->exc_traceback;
25402  #endif
25403  Py_XINCREF(*type);
25404  Py_XINCREF(*value);
25405  Py_XINCREF(*tb);
25406 }
25407 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
25408  PyObject *tmp_type, *tmp_value, *tmp_tb;
25409  #if PY_VERSION_HEX >= 0x030700A3
25410  tmp_type = tstate->exc_state.exc_type;
25411  tmp_value = tstate->exc_state.exc_value;
25412  tmp_tb = tstate->exc_state.exc_traceback;
25413  tstate->exc_state.exc_type = type;
25414  tstate->exc_state.exc_value = value;
25415  tstate->exc_state.exc_traceback = tb;
25416  #else
25417  tmp_type = tstate->exc_type;
25418  tmp_value = tstate->exc_value;
25419  tmp_tb = tstate->exc_traceback;
25420  tstate->exc_type = type;
25421  tstate->exc_value = value;
25422  tstate->exc_traceback = tb;
25423  #endif
25424  Py_XDECREF(tmp_type);
25425  Py_XDECREF(tmp_value);
25426  Py_XDECREF(tmp_tb);
25427 }
25428 #endif
25429 
25430 /* PyErrExceptionMatches */
25431 #if CYTHON_FAST_THREAD_STATE
25432 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
25433  Py_ssize_t i, n;
25434  n = PyTuple_GET_SIZE(tuple);
25435 #if PY_MAJOR_VERSION >= 3
25436  for (i=0; i<n; i++) {
25437  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
25438  }
25439 #endif
25440  for (i=0; i<n; i++) {
25441  if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
25442  }
25443  return 0;
25444 }
25445 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
25446  PyObject *exc_type = tstate->curexc_type;
25447  if (exc_type == err) return 1;
25448  if (unlikely(!exc_type)) return 0;
25449  if (unlikely(PyTuple_Check(err)))
25450  return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
25451  return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
25452 }
25453 #endif
25454 
25455 /* GetException */
25456 #if CYTHON_FAST_THREAD_STATE
25457 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25458 #else
25459 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
25460 #endif
25461  PyObject *local_type, *local_value, *local_tb;
25462 #if CYTHON_FAST_THREAD_STATE
25463  PyObject *tmp_type, *tmp_value, *tmp_tb;
25464  local_type = tstate->curexc_type;
25465  local_value = tstate->curexc_value;
25466  local_tb = tstate->curexc_traceback;
25467  tstate->curexc_type = 0;
25468  tstate->curexc_value = 0;
25469  tstate->curexc_traceback = 0;
25470 #else
25471  PyErr_Fetch(&local_type, &local_value, &local_tb);
25472 #endif
25473  PyErr_NormalizeException(&local_type, &local_value, &local_tb);
25474 #if CYTHON_FAST_THREAD_STATE
25475  if (unlikely(tstate->curexc_type))
25476 #else
25477  if (unlikely(PyErr_Occurred()))
25478 #endif
25479  goto bad;
25480  #if PY_MAJOR_VERSION >= 3
25481  if (local_tb) {
25482  if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
25483  goto bad;
25484  }
25485  #endif
25486  Py_XINCREF(local_tb);
25487  Py_XINCREF(local_type);
25488  Py_XINCREF(local_value);
25489  *type = local_type;
25490  *value = local_value;
25491  *tb = local_tb;
25492 #if CYTHON_FAST_THREAD_STATE
25493  #if PY_VERSION_HEX >= 0x030700A3
25494  tmp_type = tstate->exc_state.exc_type;
25495  tmp_value = tstate->exc_state.exc_value;
25496  tmp_tb = tstate->exc_state.exc_traceback;
25497  tstate->exc_state.exc_type = local_type;
25498  tstate->exc_state.exc_value = local_value;
25499  tstate->exc_state.exc_traceback = local_tb;
25500  #else
25501  tmp_type = tstate->exc_type;
25502  tmp_value = tstate->exc_value;
25503  tmp_tb = tstate->exc_traceback;
25504  tstate->exc_type = local_type;
25505  tstate->exc_value = local_value;
25506  tstate->exc_traceback = local_tb;
25507  #endif
25508  Py_XDECREF(tmp_type);
25509  Py_XDECREF(tmp_value);
25510  Py_XDECREF(tmp_tb);
25511 #else
25512  PyErr_SetExcInfo(local_type, local_value, local_tb);
25513 #endif
25514  return 0;
25515 bad:
25516  *type = 0;
25517  *value = 0;
25518  *tb = 0;
25519  Py_XDECREF(local_type);
25520  Py_XDECREF(local_value);
25521  Py_XDECREF(local_tb);
25522  return -1;
25523 }
25524 
25525 /* BytesEquals */
25526  static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
25527 #if CYTHON_COMPILING_IN_PYPY
25528  return PyObject_RichCompareBool(s1, s2, equals);
25529 #else
25530  if (s1 == s2) {
25531  return (equals == Py_EQ);
25532  } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
25533  const char *ps1, *ps2;
25534  Py_ssize_t length = PyBytes_GET_SIZE(s1);
25535  if (length != PyBytes_GET_SIZE(s2))
25536  return (equals == Py_NE);
25537  ps1 = PyBytes_AS_STRING(s1);
25538  ps2 = PyBytes_AS_STRING(s2);
25539  if (ps1[0] != ps2[0]) {
25540  return (equals == Py_NE);
25541  } else if (length == 1) {
25542  return (equals == Py_EQ);
25543  } else {
25544  int result;
25545 #if CYTHON_USE_UNICODE_INTERNALS
25546  Py_hash_t hash1, hash2;
25547  hash1 = ((PyBytesObject*)s1)->ob_shash;
25548  hash2 = ((PyBytesObject*)s2)->ob_shash;
25549  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
25550  return (equals == Py_NE);
25551  }
25552 #endif
25553  result = memcmp(ps1, ps2, (size_t)length);
25554  return (equals == Py_EQ) ? (result == 0) : (result != 0);
25555  }
25556  } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
25557  return (equals == Py_NE);
25558  } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
25559  return (equals == Py_NE);
25560  } else {
25561  int result;
25562  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
25563  if (!py_result)
25564  return -1;
25565  result = __Pyx_PyObject_IsTrue(py_result);
25566  Py_DECREF(py_result);
25567  return result;
25568  }
25569 #endif
25570 }
25571 
25572 /* UnicodeEquals */
25573  static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
25574 #if CYTHON_COMPILING_IN_PYPY
25575  return PyObject_RichCompareBool(s1, s2, equals);
25576 #else
25577 #if PY_MAJOR_VERSION < 3
25578  PyObject* owned_ref = NULL;
25579 #endif
25580  int s1_is_unicode, s2_is_unicode;
25581  if (s1 == s2) {
25582  goto return_eq;
25583  }
25584  s1_is_unicode = PyUnicode_CheckExact(s1);
25585  s2_is_unicode = PyUnicode_CheckExact(s2);
25586 #if PY_MAJOR_VERSION < 3
25587  if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
25588  owned_ref = PyUnicode_FromObject(s2);
25589  if (unlikely(!owned_ref))
25590  return -1;
25591  s2 = owned_ref;
25592  s2_is_unicode = 1;
25593  } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
25594  owned_ref = PyUnicode_FromObject(s1);
25595  if (unlikely(!owned_ref))
25596  return -1;
25597  s1 = owned_ref;
25598  s1_is_unicode = 1;
25599  } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
25600  return __Pyx_PyBytes_Equals(s1, s2, equals);
25601  }
25602 #endif
25603  if (s1_is_unicode & s2_is_unicode) {
25604  Py_ssize_t length;
25605  int kind;
25606  void *data1, *data2;
25607  if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
25608  return -1;
25609  length = __Pyx_PyUnicode_GET_LENGTH(s1);
25610  if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
25611  goto return_ne;
25612  }
25613 #if CYTHON_USE_UNICODE_INTERNALS
25614  {
25615  Py_hash_t hash1, hash2;
25616  #if CYTHON_PEP393_ENABLED
25617  hash1 = ((PyASCIIObject*)s1)->hash;
25618  hash2 = ((PyASCIIObject*)s2)->hash;
25619  #else
25620  hash1 = ((PyUnicodeObject*)s1)->hash;
25621  hash2 = ((PyUnicodeObject*)s2)->hash;
25622  #endif
25623  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
25624  goto return_ne;
25625  }
25626  }
25627 #endif
25628  kind = __Pyx_PyUnicode_KIND(s1);
25629  if (kind != __Pyx_PyUnicode_KIND(s2)) {
25630  goto return_ne;
25631  }
25632  data1 = __Pyx_PyUnicode_DATA(s1);
25633  data2 = __Pyx_PyUnicode_DATA(s2);
25634  if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
25635  goto return_ne;
25636  } else if (length == 1) {
25637  goto return_eq;
25638  } else {
25639  int result = memcmp(data1, data2, (size_t)(length * kind));
25640  #if PY_MAJOR_VERSION < 3
25641  Py_XDECREF(owned_ref);
25642  #endif
25643  return (equals == Py_EQ) ? (result == 0) : (result != 0);
25644  }
25645  } else if ((s1 == Py_None) & s2_is_unicode) {
25646  goto return_ne;
25647  } else if ((s2 == Py_None) & s1_is_unicode) {
25648  goto return_ne;
25649  } else {
25650  int result;
25651  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
25652  #if PY_MAJOR_VERSION < 3
25653  Py_XDECREF(owned_ref);
25654  #endif
25655  if (!py_result)
25656  return -1;
25657  result = __Pyx_PyObject_IsTrue(py_result);
25658  Py_DECREF(py_result);
25659  return result;
25660  }
25661 return_eq:
25662  #if PY_MAJOR_VERSION < 3
25663  Py_XDECREF(owned_ref);
25664  #endif
25665  return (equals == Py_EQ);
25666 return_ne:
25667  #if PY_MAJOR_VERSION < 3
25668  Py_XDECREF(owned_ref);
25669  #endif
25670  return (equals == Py_NE);
25671 #endif
25672 }
25673 
25674 /* None */
25675  static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
25676  Py_ssize_t q = a / b;
25677  Py_ssize_t r = a - q*b;
25678  q -= ((r != 0) & ((r ^ b) < 0));
25679  return q;
25680 }
25681 
25682 /* GetAttr */
25683  static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
25684 #if CYTHON_USE_TYPE_SLOTS
25685 #if PY_MAJOR_VERSION >= 3
25686  if (likely(PyUnicode_Check(n)))
25687 #else
25688  if (likely(PyString_Check(n)))
25689 #endif
25690  return __Pyx_PyObject_GetAttrStr(o, n);
25691 #endif
25692  return PyObject_GetAttr(o, n);
25693 }
25694 
25695 /* GetItemInt */
25696  static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
25697  PyObject *r;
25698  if (!j) return NULL;
25699  r = PyObject_GetItem(o, j);
25700  Py_DECREF(j);
25701  return r;
25702 }
25703 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
25704  CYTHON_NCP_UNUSED int wraparound,
25705  CYTHON_NCP_UNUSED int boundscheck) {
25706 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25707  Py_ssize_t wrapped_i = i;
25708  if (wraparound & unlikely(i < 0)) {
25709  wrapped_i += PyList_GET_SIZE(o);
25710  }
25711  if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyList_GET_SIZE(o)))) {
25712  PyObject *r = PyList_GET_ITEM(o, wrapped_i);
25713  Py_INCREF(r);
25714  return r;
25715  }
25716  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
25717 #else
25718  return PySequence_GetItem(o, i);
25719 #endif
25720 }
25721 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
25722  CYTHON_NCP_UNUSED int wraparound,
25723  CYTHON_NCP_UNUSED int boundscheck) {
25724 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25725  Py_ssize_t wrapped_i = i;
25726  if (wraparound & unlikely(i < 0)) {
25727  wrapped_i += PyTuple_GET_SIZE(o);
25728  }
25729  if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyTuple_GET_SIZE(o)))) {
25730  PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
25731  Py_INCREF(r);
25732  return r;
25733  }
25734  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
25735 #else
25736  return PySequence_GetItem(o, i);
25737 #endif
25738 }
25739 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
25740  CYTHON_NCP_UNUSED int wraparound,
25741  CYTHON_NCP_UNUSED int boundscheck) {
25742 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
25743  if (is_list || PyList_CheckExact(o)) {
25744  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
25745  if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
25746  PyObject *r = PyList_GET_ITEM(o, n);
25747  Py_INCREF(r);
25748  return r;
25749  }
25750  }
25751  else if (PyTuple_CheckExact(o)) {
25752  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
25753  if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
25754  PyObject *r = PyTuple_GET_ITEM(o, n);
25755  Py_INCREF(r);
25756  return r;
25757  }
25758  } else {
25759  PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
25760  if (likely(m && m->sq_item)) {
25761  if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
25762  Py_ssize_t l = m->sq_length(o);
25763  if (likely(l >= 0)) {
25764  i += l;
25765  } else {
25766  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
25767  return NULL;
25768  PyErr_Clear();
25769  }
25770  }
25771  return m->sq_item(o, i);
25772  }
25773  }
25774 #else
25775  if (is_list || PySequence_Check(o)) {
25776  return PySequence_GetItem(o, i);
25777  }
25778 #endif
25779  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
25780 }
25781 
25782 /* ObjectGetItem */
25783  #if CYTHON_USE_TYPE_SLOTS
25784 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
25785  PyObject *runerr;
25786  Py_ssize_t key_value;
25787  PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
25788  if (unlikely(!(m && m->sq_item))) {
25789  PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
25790  return NULL;
25791  }
25792  key_value = __Pyx_PyIndex_AsSsize_t(index);
25793  if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
25794  return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
25795  }
25796  if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
25797  PyErr_Clear();
25798  PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
25799  }
25800  return NULL;
25801 }
25802 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
25803  PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
25804  if (likely(m && m->mp_subscript)) {
25805  return m->mp_subscript(obj, key);
25806  }
25807  return __Pyx_PyObject_GetIndex(obj, key);
25808 }
25809 #endif
25810 
25811 /* decode_c_string */
25812  static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
25813  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
25814  const char* encoding, const char* errors,
25815  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
25816  Py_ssize_t length;
25817  if (unlikely((start < 0) | (stop < 0))) {
25818  size_t slen = strlen(cstring);
25819  if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
25820  PyErr_SetString(PyExc_OverflowError,
25821  "c-string too long to convert to Python");
25822  return NULL;
25823  }
25824  length = (Py_ssize_t) slen;
25825  if (start < 0) {
25826  start += length;
25827  if (start < 0)
25828  start = 0;
25829  }
25830  if (stop < 0)
25831  stop += length;
25832  }
25833  length = stop - start;
25834  if (unlikely(length <= 0))
25835  return PyUnicode_FromUnicode(NULL, 0);
25836  cstring += start;
25837  if (decode_func) {
25838  return decode_func(cstring, length, errors);
25839  } else {
25840  return PyUnicode_Decode(cstring, length, encoding, errors);
25841  }
25842 }
25843 
25844 /* GetAttr3 */
25845  static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
25846  __Pyx_PyThreadState_declare
25847  __Pyx_PyThreadState_assign
25848  if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
25849  return NULL;
25850  __Pyx_PyErr_Clear();
25851  Py_INCREF(d);
25852  return d;
25853 }
25854 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
25855  PyObject *r = __Pyx_GetAttr(o, n);
25856  return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
25857 }
25858 
25859 /* GetModuleGlobalName */
25860  static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
25861  PyObject *result;
25862 #if !CYTHON_AVOID_BORROWED_REFS
25863 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
25864  result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
25865  if (likely(result)) {
25866  Py_INCREF(result);
25867  } else if (unlikely(PyErr_Occurred())) {
25868  result = NULL;
25869  } else {
25870 #else
25871  result = PyDict_GetItem(__pyx_d, name);
25872  if (likely(result)) {
25873  Py_INCREF(result);
25874  } else {
25875 #endif
25876 #else
25877  result = PyObject_GetItem(__pyx_d, name);
25878  if (!result) {
25879  PyErr_Clear();
25880 #endif
25881  result = __Pyx_GetBuiltinName(name);
25882  }
25883  return result;
25884 }
25885 
25886 /* SwapException */
25887  #if CYTHON_FAST_THREAD_STATE
25888 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25889  PyObject *tmp_type, *tmp_value, *tmp_tb;
25890  #if PY_VERSION_HEX >= 0x030700A3
25891  tmp_type = tstate->exc_state.exc_type;
25892  tmp_value = tstate->exc_state.exc_value;
25893  tmp_tb = tstate->exc_state.exc_traceback;
25894  tstate->exc_state.exc_type = *type;
25895  tstate->exc_state.exc_value = *value;
25896  tstate->exc_state.exc_traceback = *tb;
25897  #else
25898  tmp_type = tstate->exc_type;
25899  tmp_value = tstate->exc_value;
25900  tmp_tb = tstate->exc_traceback;
25901  tstate->exc_type = *type;
25902  tstate->exc_value = *value;
25903  tstate->exc_traceback = *tb;
25904  #endif
25905  *type = tmp_type;
25906  *value = tmp_value;
25907  *tb = tmp_tb;
25908 }
25909 #else
25910 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
25911  PyObject *tmp_type, *tmp_value, *tmp_tb;
25912  PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
25913  PyErr_SetExcInfo(*type, *value, *tb);
25914  *type = tmp_type;
25915  *value = tmp_value;
25916  *tb = tmp_tb;
25917 }
25918 #endif
25919 
25920 /* Import */
25921  static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
25922  PyObject *empty_list = 0;
25923  PyObject *module = 0;
25924  PyObject *global_dict = 0;
25925  PyObject *empty_dict = 0;
25926  PyObject *list;
25927  #if PY_MAJOR_VERSION < 3
25928  PyObject *py_import;
25929  py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
25930  if (!py_import)
25931  goto bad;
25932  #endif
25933  if (from_list)
25934  list = from_list;
25935  else {
25936  empty_list = PyList_New(0);
25937  if (!empty_list)
25938  goto bad;
25939  list = empty_list;
25940  }
25941  global_dict = PyModule_GetDict(__pyx_m);
25942  if (!global_dict)
25943  goto bad;
25944  empty_dict = PyDict_New();
25945  if (!empty_dict)
25946  goto bad;
25947  {
25948  #if PY_MAJOR_VERSION >= 3
25949  if (level == -1) {
25950  if (strchr(__Pyx_MODULE_NAME, '.')) {
25951  module = PyImport_ImportModuleLevelObject(
25952  name, global_dict, empty_dict, list, 1);
25953  if (!module) {
25954  if (!PyErr_ExceptionMatches(PyExc_ImportError))
25955  goto bad;
25956  PyErr_Clear();
25957  }
25958  }
25959  level = 0;
25960  }
25961  #endif
25962  if (!module) {
25963  #if PY_MAJOR_VERSION < 3
25964  PyObject *py_level = PyInt_FromLong(level);
25965  if (!py_level)
25966  goto bad;
25967  module = PyObject_CallFunctionObjArgs(py_import,
25968  name, global_dict, empty_dict, list, py_level, NULL);
25969  Py_DECREF(py_level);
25970  #else
25971  module = PyImport_ImportModuleLevelObject(
25972  name, global_dict, empty_dict, list, level);
25973  #endif
25974  }
25975  }
25976 bad:
25977  #if PY_MAJOR_VERSION < 3
25978  Py_XDECREF(py_import);
25979  #endif
25980  Py_XDECREF(empty_list);
25981  Py_XDECREF(empty_dict);
25982  return module;
25983 }
25984 
25985 /* FastTypeChecks */
25986  #if CYTHON_COMPILING_IN_CPYTHON
25987 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
25988  while (a) {
25989  a = a->tp_base;
25990  if (a == b)
25991  return 1;
25992  }
25993  return b == &PyBaseObject_Type;
25994 }
25995 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
25996  PyObject *mro;
25997  if (a == b) return 1;
25998  mro = a->tp_mro;
25999  if (likely(mro)) {
26000  Py_ssize_t i, n;
26001  n = PyTuple_GET_SIZE(mro);
26002  for (i = 0; i < n; i++) {
26003  if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
26004  return 1;
26005  }
26006  return 0;
26007  }
26008  return __Pyx_InBases(a, b);
26009 }
26010 #if PY_MAJOR_VERSION == 2
26011 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
26012  PyObject *exception, *value, *tb;
26013  int res;
26014  __Pyx_PyThreadState_declare
26015  __Pyx_PyThreadState_assign
26016  __Pyx_ErrFetch(&exception, &value, &tb);
26017  res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
26018  if (unlikely(res == -1)) {
26019  PyErr_WriteUnraisable(err);
26020  res = 0;
26021  }
26022  if (!res) {
26023  res = PyObject_IsSubclass(err, exc_type2);
26024  if (unlikely(res == -1)) {
26025  PyErr_WriteUnraisable(err);
26026  res = 0;
26027  }
26028  }
26029  __Pyx_ErrRestore(exception, value, tb);
26030  return res;
26031 }
26032 #else
26033 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
26034  int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
26035  if (!res) {
26036  res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
26037  }
26038  return res;
26039 }
26040 #endif
26041 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
26042  Py_ssize_t i, n;
26043  assert(PyExceptionClass_Check(exc_type));
26044  n = PyTuple_GET_SIZE(tuple);
26045 #if PY_MAJOR_VERSION >= 3
26046  for (i=0; i<n; i++) {
26047  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
26048  }
26049 #endif
26050  for (i=0; i<n; i++) {
26051  PyObject *t = PyTuple_GET_ITEM(tuple, i);
26052  #if PY_MAJOR_VERSION < 3
26053  if (likely(exc_type == t)) return 1;
26054  #endif
26055  if (likely(PyExceptionClass_Check(t))) {
26056  if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
26057  } else {
26058  }
26059  }
26060  return 0;
26061 }
26062 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
26063  if (likely(err == exc_type)) return 1;
26064  if (likely(PyExceptionClass_Check(err))) {
26065  if (likely(PyExceptionClass_Check(exc_type))) {
26066  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
26067  } else if (likely(PyTuple_Check(exc_type))) {
26068  return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
26069  } else {
26070  }
26071  }
26072  return PyErr_GivenExceptionMatches(err, exc_type);
26073 }
26074 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
26075  assert(PyExceptionClass_Check(exc_type1));
26076  assert(PyExceptionClass_Check(exc_type2));
26077  if (likely(err == exc_type1 || err == exc_type2)) return 1;
26078  if (likely(PyExceptionClass_Check(err))) {
26079  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
26080  }
26081  return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
26082 }
26083 #endif
26084 
26085 /* PyIntBinop */
26086  #if !CYTHON_COMPILING_IN_PYPY
26087 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
26088  #if PY_MAJOR_VERSION < 3
26089  if (likely(PyInt_CheckExact(op1))) {
26090  const long b = intval;
26091  long x;
26092  long a = PyInt_AS_LONG(op1);
26093  x = (long)((unsigned long)a + b);
26094  if (likely((x^a) >= 0 || (x^b) >= 0))
26095  return PyInt_FromLong(x);
26096  return PyLong_Type.tp_as_number->nb_add(op1, op2);
26097  }
26098  #endif
26099  #if CYTHON_USE_PYLONG_INTERNALS
26100  if (likely(PyLong_CheckExact(op1))) {
26101  const long b = intval;
26102  long a, x;
26103 #ifdef HAVE_LONG_LONG
26104  const PY_LONG_LONG llb = intval;
26105  PY_LONG_LONG lla, llx;
26106 #endif
26107  const digit* digits = ((PyLongObject*)op1)->ob_digit;
26108  const Py_ssize_t size = Py_SIZE(op1);
26109  if (likely(__Pyx_sst_abs(size) <= 1)) {
26110  a = likely(size) ? digits[0] : 0;
26111  if (size == -1) a = -a;
26112  } else {
26113  switch (size) {
26114  case -2:
26115  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
26116  a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
26117  break;
26118 #ifdef HAVE_LONG_LONG
26119  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
26120  lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
26121  goto long_long;
26122 #endif
26123  }
26124  CYTHON_FALLTHROUGH;
26125  case 2:
26126  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
26127  a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
26128  break;
26129 #ifdef HAVE_LONG_LONG
26130  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
26131  lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
26132  goto long_long;
26133 #endif
26134  }
26135  CYTHON_FALLTHROUGH;
26136  case -3:
26137  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
26138  a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
26139  break;
26140 #ifdef HAVE_LONG_LONG
26141  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
26142  lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
26143  goto long_long;
26144 #endif
26145  }
26146  CYTHON_FALLTHROUGH;
26147  case 3:
26148  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
26149  a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
26150  break;
26151 #ifdef HAVE_LONG_LONG
26152  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
26153  lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
26154  goto long_long;
26155 #endif
26156  }
26157  CYTHON_FALLTHROUGH;
26158  case -4:
26159  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
26160  a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
26161  break;
26162 #ifdef HAVE_LONG_LONG
26163  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
26164  lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
26165  goto long_long;
26166 #endif
26167  }
26168  CYTHON_FALLTHROUGH;
26169  case 4:
26170  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
26171  a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
26172  break;
26173 #ifdef HAVE_LONG_LONG
26174  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
26175  lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
26176  goto long_long;
26177 #endif
26178  }
26179  CYTHON_FALLTHROUGH;
26180  default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
26181  }
26182  }
26183  x = a + b;
26184  return PyLong_FromLong(x);
26185 #ifdef HAVE_LONG_LONG
26186  long_long:
26187  llx = lla + llb;
26188  return PyLong_FromLongLong(llx);
26189 #endif
26190 
26191 
26192  }
26193  #endif
26194  if (PyFloat_CheckExact(op1)) {
26195  const long b = intval;
26196  double a = PyFloat_AS_DOUBLE(op1);
26197  double result;
26198  PyFPE_START_PROTECT("add", return NULL)
26199  result = ((double)a) + (double)b;
26200  PyFPE_END_PROTECT(result)
26201  return PyFloat_FromDouble(result);
26202  }
26203  return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
26204 }
26205 #endif
26206 
26207 /* None */
26208  static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
26209  PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
26210 }
26211 
26212 /* None */
26213  static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
26214  long q = a / b;
26215  long r = a - q*b;
26216  q -= ((r != 0) & ((r ^ b) < 0));
26217  return q;
26218 }
26219 
26220 /* ImportFrom */
26221  static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
26222  PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
26223  if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
26224  PyErr_Format(PyExc_ImportError,
26225  #if PY_MAJOR_VERSION < 3
26226  "cannot import name %.230s", PyString_AS_STRING(name));
26227  #else
26228  "cannot import name %S", name);
26229  #endif
26230  }
26231  return value;
26232 }
26233 
26234 /* HasAttr */
26235  static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
26236  PyObject *r;
26237  if (unlikely(!__Pyx_PyBaseString_Check(n))) {
26238  PyErr_SetString(PyExc_TypeError,
26239  "hasattr(): attribute name must be string");
26240  return -1;
26241  }
26242  r = __Pyx_GetAttr(o, n);
26243  if (unlikely(!r)) {
26244  PyErr_Clear();
26245  return 0;
26246  } else {
26247  Py_DECREF(r);
26248  return 1;
26249  }
26250 }
26251 
26252 /* PyObject_GenericGetAttrNoDict */
26253  #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
26254 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
26255  PyErr_Format(PyExc_AttributeError,
26256 #if PY_MAJOR_VERSION >= 3
26257  "'%.50s' object has no attribute '%U'",
26258  tp->tp_name, attr_name);
26259 #else
26260  "'%.50s' object has no attribute '%.400s'",
26261  tp->tp_name, PyString_AS_STRING(attr_name));
26262 #endif
26263  return NULL;
26264 }
26265 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
26266  PyObject *descr;
26267  PyTypeObject *tp = Py_TYPE(obj);
26268  if (unlikely(!PyString_Check(attr_name))) {
26269  return PyObject_GenericGetAttr(obj, attr_name);
26270  }
26271  assert(!tp->tp_dictoffset);
26272  descr = _PyType_Lookup(tp, attr_name);
26273  if (unlikely(!descr)) {
26274  return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
26275  }
26276  Py_INCREF(descr);
26277  #if PY_MAJOR_VERSION < 3
26278  if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
26279  #endif
26280  {
26281  descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
26282  if (unlikely(f)) {
26283  PyObject *res = f(descr, obj, (PyObject *)tp);
26284  Py_DECREF(descr);
26285  return res;
26286  }
26287  }
26288  return descr;
26289 }
26290 #endif
26291 
26292 /* PyObject_GenericGetAttr */
26293  #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
26294 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
26295  if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
26296  return PyObject_GenericGetAttr(obj, attr_name);
26297  }
26298  return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
26299 }
26300 #endif
26301 
26302 /* SetupReduce */
26303  static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
26304  int ret;
26305  PyObject *name_attr;
26306  name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
26307  if (likely(name_attr)) {
26308  ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
26309  } else {
26310  ret = -1;
26311  }
26312  if (unlikely(ret < 0)) {
26313  PyErr_Clear();
26314  ret = 0;
26315  }
26316  Py_XDECREF(name_attr);
26317  return ret;
26318 }
26319 static int __Pyx_setup_reduce(PyObject* type_obj) {
26320  int ret = 0;
26321  PyObject *object_reduce = NULL;
26322  PyObject *object_reduce_ex = NULL;
26323  PyObject *reduce = NULL;
26324  PyObject *reduce_ex = NULL;
26325  PyObject *reduce_cython = NULL;
26326  PyObject *setstate = NULL;
26327  PyObject *setstate_cython = NULL;
26328 #if CYTHON_USE_PYTYPE_LOOKUP
26329  if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto GOOD;
26330 #else
26331  if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto GOOD;
26332 #endif
26333 #if CYTHON_USE_PYTYPE_LOOKUP
26334  object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
26335 #else
26336  object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
26337 #endif
26338  reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto BAD;
26339  if (reduce_ex == object_reduce_ex) {
26340 #if CYTHON_USE_PYTYPE_LOOKUP
26341  object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
26342 #else
26343  object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
26344 #endif
26345  reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto BAD;
26346  if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
26347  reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto BAD;
26348  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto BAD;
26349  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto BAD;
26350  setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
26351  if (!setstate) PyErr_Clear();
26352  if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
26353  setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto BAD;
26354  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD;
26355  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD;
26356  }
26357  PyType_Modified((PyTypeObject*)type_obj);
26358  }
26359  }
26360  goto GOOD;
26361 BAD:
26362  if (!PyErr_Occurred())
26363  PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
26364  ret = -1;
26365 GOOD:
26366 #if !CYTHON_USE_PYTYPE_LOOKUP
26367  Py_XDECREF(object_reduce);
26368  Py_XDECREF(object_reduce_ex);
26369 #endif
26370  Py_XDECREF(reduce);
26371  Py_XDECREF(reduce_ex);
26372  Py_XDECREF(reduce_cython);
26373  Py_XDECREF(setstate);
26374  Py_XDECREF(setstate_cython);
26375  return ret;
26376 }
26377 
26378 /* SetVTable */
26379  static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
26380 #if PY_VERSION_HEX >= 0x02070000
26381  PyObject *ob = PyCapsule_New(vtable, 0, 0);
26382 #else
26383  PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
26384 #endif
26385  if (!ob)
26386  goto bad;
26387  if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
26388  goto bad;
26389  Py_DECREF(ob);
26390  return 0;
26391 bad:
26392  Py_XDECREF(ob);
26393  return -1;
26394 }
26395 
26396 /* CalculateMetaclass */
26397  static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
26398  Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
26399  for (i=0; i < nbases; i++) {
26400  PyTypeObject *tmptype;
26401  PyObject *tmp = PyTuple_GET_ITEM(bases, i);
26402  tmptype = Py_TYPE(tmp);
26403 #if PY_MAJOR_VERSION < 3
26404  if (tmptype == &PyClass_Type)
26405  continue;
26406 #endif
26407  if (!metaclass) {
26408  metaclass = tmptype;
26409  continue;
26410  }
26411  if (PyType_IsSubtype(metaclass, tmptype))
26412  continue;
26413  if (PyType_IsSubtype(tmptype, metaclass)) {
26414  metaclass = tmptype;
26415  continue;
26416  }
26417  PyErr_SetString(PyExc_TypeError,
26418  "metaclass conflict: "
26419  "the metaclass of a derived class "
26420  "must be a (non-strict) subclass "
26421  "of the metaclasses of all its bases");
26422  return NULL;
26423  }
26424  if (!metaclass) {
26425 #if PY_MAJOR_VERSION < 3
26426  metaclass = &PyClass_Type;
26427 #else
26428  metaclass = &PyType_Type;
26429 #endif
26430  }
26431  Py_INCREF((PyObject*) metaclass);
26432  return (PyObject*) metaclass;
26433 }
26434 
26435 /* FetchCommonType */
26436  static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
26437  PyObject* fake_module;
26438  PyTypeObject* cached_type = NULL;
26439  fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
26440  if (!fake_module) return NULL;
26441  Py_INCREF(fake_module);
26442  cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
26443  if (cached_type) {
26444  if (!PyType_Check((PyObject*)cached_type)) {
26445  PyErr_Format(PyExc_TypeError,
26446  "Shared Cython type %.200s is not a type object",
26447  type->tp_name);
26448  goto bad;
26449  }
26450  if (cached_type->tp_basicsize != type->tp_basicsize) {
26451  PyErr_Format(PyExc_TypeError,
26452  "Shared Cython type %.200s has the wrong size, try recompiling",
26453  type->tp_name);
26454  goto bad;
26455  }
26456  } else {
26457  if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
26458  PyErr_Clear();
26459  if (PyType_Ready(type) < 0) goto bad;
26460  if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
26461  goto bad;
26462  Py_INCREF(type);
26463  cached_type = type;
26464  }
26465 done:
26466  Py_DECREF(fake_module);
26467  return cached_type;
26468 bad:
26469  Py_XDECREF(cached_type);
26470  cached_type = NULL;
26471  goto done;
26472 }
26473 
26474 /* CythonFunction */
26475  #include <structmember.h>
26476 static PyObject *
26477 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
26478 {
26479  if (unlikely(op->func_doc == NULL)) {
26480  if (op->func.m_ml->ml_doc) {
26481 #if PY_MAJOR_VERSION >= 3
26482  op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
26483 #else
26484  op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
26485 #endif
26486  if (unlikely(op->func_doc == NULL))
26487  return NULL;
26488  } else {
26489  Py_INCREF(Py_None);
26490  return Py_None;
26491  }
26492  }
26493  Py_INCREF(op->func_doc);
26494  return op->func_doc;
26495 }
26496 static int
26497 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value)
26498 {
26499  PyObject *tmp = op->func_doc;
26500  if (value == NULL) {
26501  value = Py_None;
26502  }
26503  Py_INCREF(value);
26504  op->func_doc = value;
26505  Py_XDECREF(tmp);
26506  return 0;
26507 }
26508 static PyObject *
26509 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op)
26510 {
26511  if (unlikely(op->func_name == NULL)) {
26512 #if PY_MAJOR_VERSION >= 3
26513  op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
26514 #else
26515  op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
26516 #endif
26517  if (unlikely(op->func_name == NULL))
26518  return NULL;
26519  }
26520  Py_INCREF(op->func_name);
26521  return op->func_name;
26522 }
26523 static int
26524 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value)
26525 {
26526  PyObject *tmp;
26527 #if PY_MAJOR_VERSION >= 3
26528  if (unlikely(value == NULL || !PyUnicode_Check(value))) {
26529 #else
26530  if (unlikely(value == NULL || !PyString_Check(value))) {
26531 #endif
26532  PyErr_SetString(PyExc_TypeError,
26533  "__name__ must be set to a string object");
26534  return -1;
26535  }
26536  tmp = op->func_name;
26537  Py_INCREF(value);
26538  op->func_name = value;
26539  Py_XDECREF(tmp);
26540  return 0;
26541 }
26542 static PyObject *
26543 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op)
26544 {
26545  Py_INCREF(op->func_qualname);
26546  return op->func_qualname;
26547 }
26548 static int
26549 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value)
26550 {
26551  PyObject *tmp;
26552 #if PY_MAJOR_VERSION >= 3
26553  if (unlikely(value == NULL || !PyUnicode_Check(value))) {
26554 #else
26555  if (unlikely(value == NULL || !PyString_Check(value))) {
26556 #endif
26557  PyErr_SetString(PyExc_TypeError,
26558  "__qualname__ must be set to a string object");
26559  return -1;
26560  }
26561  tmp = op->func_qualname;
26562  Py_INCREF(value);
26563  op->func_qualname = value;
26564  Py_XDECREF(tmp);
26565  return 0;
26566 }
26567 static PyObject *
26568 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
26569 {
26570  PyObject *self;
26571  self = m->func_closure;
26572  if (self == NULL)
26573  self = Py_None;
26574  Py_INCREF(self);
26575  return self;
26576 }
26577 static PyObject *
26578 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op)
26579 {
26580  if (unlikely(op->func_dict == NULL)) {
26581  op->func_dict = PyDict_New();
26582  if (unlikely(op->func_dict == NULL))
26583  return NULL;
26584  }
26585  Py_INCREF(op->func_dict);
26586  return op->func_dict;
26587 }
26588 static int
26589 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value)
26590 {
26591  PyObject *tmp;
26592  if (unlikely(value == NULL)) {
26593  PyErr_SetString(PyExc_TypeError,
26594  "function's dictionary may not be deleted");
26595  return -1;
26596  }
26597  if (unlikely(!PyDict_Check(value))) {
26598  PyErr_SetString(PyExc_TypeError,
26599  "setting function's dictionary to a non-dict");
26600  return -1;
26601  }
26602  tmp = op->func_dict;
26603  Py_INCREF(value);
26604  op->func_dict = value;
26605  Py_XDECREF(tmp);
26606  return 0;
26607 }
26608 static PyObject *
26609 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op)
26610 {
26611  Py_INCREF(op->func_globals);
26612  return op->func_globals;
26613 }
26614 static PyObject *
26615 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op)
26616 {
26617  Py_INCREF(Py_None);
26618  return Py_None;
26619 }
26620 static PyObject *
26621 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op)
26622 {
26623  PyObject* result = (op->func_code) ? op->func_code : Py_None;
26624  Py_INCREF(result);
26625  return result;
26626 }
26627 static int
26628 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
26629  int result = 0;
26630  PyObject *res = op->defaults_getter((PyObject *) op);
26631  if (unlikely(!res))
26632  return -1;
26633  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
26634  op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
26635  Py_INCREF(op->defaults_tuple);
26636  op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
26637  Py_INCREF(op->defaults_kwdict);
26638  #else
26639  op->defaults_tuple = PySequence_ITEM(res, 0);
26640  if (unlikely(!op->defaults_tuple)) result = -1;
26641  else {
26642  op->defaults_kwdict = PySequence_ITEM(res, 1);
26643  if (unlikely(!op->defaults_kwdict)) result = -1;
26644  }
26645  #endif
26646  Py_DECREF(res);
26647  return result;
26648 }
26649 static int
26650 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) {
26651  PyObject* tmp;
26652  if (!value) {
26653  value = Py_None;
26654  } else if (value != Py_None && !PyTuple_Check(value)) {
26655  PyErr_SetString(PyExc_TypeError,
26656  "__defaults__ must be set to a tuple object");
26657  return -1;
26658  }
26659  Py_INCREF(value);
26660  tmp = op->defaults_tuple;
26661  op->defaults_tuple = value;
26662  Py_XDECREF(tmp);
26663  return 0;
26664 }
26665 static PyObject *
26666 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) {
26667  PyObject* result = op->defaults_tuple;
26668  if (unlikely(!result)) {
26669  if (op->defaults_getter) {
26670  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
26671  result = op->defaults_tuple;
26672  } else {
26673  result = Py_None;
26674  }
26675  }
26676  Py_INCREF(result);
26677  return result;
26678 }
26679 static int
26680 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) {
26681  PyObject* tmp;
26682  if (!value) {
26683  value = Py_None;
26684  } else if (value != Py_None && !PyDict_Check(value)) {
26685  PyErr_SetString(PyExc_TypeError,
26686  "__kwdefaults__ must be set to a dict object");
26687  return -1;
26688  }
26689  Py_INCREF(value);
26690  tmp = op->defaults_kwdict;
26691  op->defaults_kwdict = value;
26692  Py_XDECREF(tmp);
26693  return 0;
26694 }
26695 static PyObject *
26696 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) {
26697  PyObject* result = op->defaults_kwdict;
26698  if (unlikely(!result)) {
26699  if (op->defaults_getter) {
26700  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
26701  result = op->defaults_kwdict;
26702  } else {
26703  result = Py_None;
26704  }
26705  }
26706  Py_INCREF(result);
26707  return result;
26708 }
26709 static int
26710 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) {
26711  PyObject* tmp;
26712  if (!value || value == Py_None) {
26713  value = NULL;
26714  } else if (!PyDict_Check(value)) {
26715  PyErr_SetString(PyExc_TypeError,
26716  "__annotations__ must be set to a dict object");
26717  return -1;
26718  }
26719  Py_XINCREF(value);
26720  tmp = op->func_annotations;
26721  op->func_annotations = value;
26722  Py_XDECREF(tmp);
26723  return 0;
26724 }
26725 static PyObject *
26726 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) {
26727  PyObject* result = op->func_annotations;
26728  if (unlikely(!result)) {
26729  result = PyDict_New();
26730  if (unlikely(!result)) return NULL;
26731  op->func_annotations = result;
26732  }
26733  Py_INCREF(result);
26734  return result;
26735 }
26736 static PyGetSetDef __pyx_CyFunction_getsets[] = {
26737  {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
26738  {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
26739  {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
26740  {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
26741  {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
26742  {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
26743  {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
26744  {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
26745  {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
26746  {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
26747  {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
26748  {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
26749  {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
26750  {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
26751  {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
26752  {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
26753  {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
26754  {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
26755  {0, 0, 0, 0, 0}
26756 };
26757 static PyMemberDef __pyx_CyFunction_members[] = {
26758  {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
26759  {0, 0, 0, 0, 0}
26760 };
26761 static PyObject *
26762 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
26763 {
26764 #if PY_MAJOR_VERSION >= 3
26765  return PyUnicode_FromString(m->func.m_ml->ml_name);
26766 #else
26767  return PyString_FromString(m->func.m_ml->ml_name);
26768 #endif
26769 }
26770 static PyMethodDef __pyx_CyFunction_methods[] = {
26771  {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
26772  {0, 0, 0, 0}
26773 };
26774 #if PY_VERSION_HEX < 0x030500A0
26775 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
26776 #else
26777 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
26778 #endif
26779 static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname,
26780  PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
26781  __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
26782  if (op == NULL)
26783  return NULL;
26784  op->flags = flags;
26785  __Pyx_CyFunction_weakreflist(op) = NULL;
26786  op->func.m_ml = ml;
26787  op->func.m_self = (PyObject *) op;
26788  Py_XINCREF(closure);
26789  op->func_closure = closure;
26790  Py_XINCREF(module);
26791  op->func.m_module = module;
26792  op->func_dict = NULL;
26793  op->func_name = NULL;
26794  Py_INCREF(qualname);
26795  op->func_qualname = qualname;
26796  op->func_doc = NULL;
26797  op->func_classobj = NULL;
26798  op->func_globals = globals;
26799  Py_INCREF(op->func_globals);
26800  Py_XINCREF(code);
26801  op->func_code = code;
26802  op->defaults_pyobjects = 0;
26803  op->defaults = NULL;
26804  op->defaults_tuple = NULL;
26805  op->defaults_kwdict = NULL;
26806  op->defaults_getter = NULL;
26807  op->func_annotations = NULL;
26808  PyObject_GC_Track(op);
26809  return (PyObject *) op;
26810 }
26811 static int
26812 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
26813 {
26814  Py_CLEAR(m->func_closure);
26815  Py_CLEAR(m->func.m_module);
26816  Py_CLEAR(m->func_dict);
26817  Py_CLEAR(m->func_name);
26818  Py_CLEAR(m->func_qualname);
26819  Py_CLEAR(m->func_doc);
26820  Py_CLEAR(m->func_globals);
26821  Py_CLEAR(m->func_code);
26822  Py_CLEAR(m->func_classobj);
26823  Py_CLEAR(m->defaults_tuple);
26824  Py_CLEAR(m->defaults_kwdict);
26825  Py_CLEAR(m->func_annotations);
26826  if (m->defaults) {
26827  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
26828  int i;
26829  for (i = 0; i < m->defaults_pyobjects; i++)
26830  Py_XDECREF(pydefaults[i]);
26831  PyObject_Free(m->defaults);
26832  m->defaults = NULL;
26833  }
26834  return 0;
26835 }
26836 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
26837 {
26838  if (__Pyx_CyFunction_weakreflist(m) != NULL)
26839  PyObject_ClearWeakRefs((PyObject *) m);
26840  __Pyx_CyFunction_clear(m);
26841  PyObject_GC_Del(m);
26842 }
26843 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
26844 {
26845  PyObject_GC_UnTrack(m);
26846  __Pyx__CyFunction_dealloc(m);
26847 }
26848 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
26849 {
26850  Py_VISIT(m->func_closure);
26851  Py_VISIT(m->func.m_module);
26852  Py_VISIT(m->func_dict);
26853  Py_VISIT(m->func_name);
26854  Py_VISIT(m->func_qualname);
26855  Py_VISIT(m->func_doc);
26856  Py_VISIT(m->func_globals);
26857  Py_VISIT(m->func_code);
26858  Py_VISIT(m->func_classobj);
26859  Py_VISIT(m->defaults_tuple);
26860  Py_VISIT(m->defaults_kwdict);
26861  if (m->defaults) {
26862  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
26863  int i;
26864  for (i = 0; i < m->defaults_pyobjects; i++)
26865  Py_VISIT(pydefaults[i]);
26866  }
26867  return 0;
26868 }
26869 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
26870 {
26871  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26872  if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
26873  Py_INCREF(func);
26874  return func;
26875  }
26876  if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
26877  if (type == NULL)
26878  type = (PyObject *)(Py_TYPE(obj));
26879  return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
26880  }
26881  if (obj == Py_None)
26882  obj = NULL;
26883  return __Pyx_PyMethod_New(func, obj, type);
26884 }
26885 static PyObject*
26886 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
26887 {
26888 #if PY_MAJOR_VERSION >= 3
26889  return PyUnicode_FromFormat("<cyfunction %U at %p>",
26890  op->func_qualname, (void *)op);
26891 #else
26892  return PyString_FromFormat("<cyfunction %s at %p>",
26893  PyString_AsString(op->func_qualname), (void *)op);
26894 #endif
26895 }
26896 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
26897  PyCFunctionObject* f = (PyCFunctionObject*)func;
26898  PyCFunction meth = f->m_ml->ml_meth;
26899  Py_ssize_t size;
26900  switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
26901  case METH_VARARGS:
26902  if (likely(kw == NULL || PyDict_Size(kw) == 0))
26903  return (*meth)(self, arg);
26904  break;
26905  case METH_VARARGS | METH_KEYWORDS:
26906  return (*(PyCFunctionWithKeywords)meth)(self, arg, kw);
26907  case METH_NOARGS:
26908  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
26909  size = PyTuple_GET_SIZE(arg);
26910  if (likely(size == 0))
26911  return (*meth)(self, NULL);
26912  PyErr_Format(PyExc_TypeError,
26913  "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
26914  f->m_ml->ml_name, size);
26915  return NULL;
26916  }
26917  break;
26918  case METH_O:
26919  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
26920  size = PyTuple_GET_SIZE(arg);
26921  if (likely(size == 1)) {
26922  PyObject *result, *arg0;
26923  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
26924  arg0 = PyTuple_GET_ITEM(arg, 0);
26925  #else
26926  arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
26927  #endif
26928  result = (*meth)(self, arg0);
26929  #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
26930  Py_DECREF(arg0);
26931  #endif
26932  return result;
26933  }
26934  PyErr_Format(PyExc_TypeError,
26935  "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
26936  f->m_ml->ml_name, size);
26937  return NULL;
26938  }
26939  break;
26940  default:
26941  PyErr_SetString(PyExc_SystemError, "Bad call flags in "
26942  "__Pyx_CyFunction_Call. METH_OLDARGS is no "
26943  "longer supported!");
26944  return NULL;
26945  }
26946  PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
26947  f->m_ml->ml_name);
26948  return NULL;
26949 }
26950 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
26951  return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
26952 }
26953 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
26954  PyObject *result;
26955  __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
26956  if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
26957  Py_ssize_t argc;
26958  PyObject *new_args;
26959  PyObject *self;
26960  argc = PyTuple_GET_SIZE(args);
26961  new_args = PyTuple_GetSlice(args, 1, argc);
26962  if (unlikely(!new_args))
26963  return NULL;
26964  self = PyTuple_GetItem(args, 0);
26965  if (unlikely(!self)) {
26966  Py_DECREF(new_args);
26967  return NULL;
26968  }
26969  result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
26970  Py_DECREF(new_args);
26971  } else {
26972  result = __Pyx_CyFunction_Call(func, args, kw);
26973  }
26974  return result;
26975 }
26976 static PyTypeObject __pyx_CyFunctionType_type = {
26977  PyVarObject_HEAD_INIT(0, 0)
26978  "cython_function_or_method",
26979  sizeof(__pyx_CyFunctionObject),
26980  0,
26981  (destructor) __Pyx_CyFunction_dealloc,
26982  0,
26983  0,
26984  0,
26985 #if PY_MAJOR_VERSION < 3
26986  0,
26987 #else
26988  0,
26989 #endif
26990  (reprfunc) __Pyx_CyFunction_repr,
26991  0,
26992  0,
26993  0,
26994  0,
26995  __Pyx_CyFunction_CallAsMethod,
26996  0,
26997  0,
26998  0,
26999  0,
27000  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
27001  0,
27002  (traverseproc) __Pyx_CyFunction_traverse,
27003  (inquiry) __Pyx_CyFunction_clear,
27004  0,
27005 #if PY_VERSION_HEX < 0x030500A0
27006  offsetof(__pyx_CyFunctionObject, func_weakreflist),
27007 #else
27008  offsetof(PyCFunctionObject, m_weakreflist),
27009 #endif
27010  0,
27011  0,
27012  __pyx_CyFunction_methods,
27013  __pyx_CyFunction_members,
27014  __pyx_CyFunction_getsets,
27015  0,
27016  0,
27017  __Pyx_CyFunction_descr_get,
27018  0,
27019  offsetof(__pyx_CyFunctionObject, func_dict),
27020  0,
27021  0,
27022  0,
27023  0,
27024  0,
27025  0,
27026  0,
27027  0,
27028  0,
27029  0,
27030  0,
27031  0,
27032 #if PY_VERSION_HEX >= 0x030400a1
27033  0,
27034 #endif
27035 };
27036 static int __pyx_CyFunction_init(void) {
27037  __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
27038  if (unlikely(__pyx_CyFunctionType == NULL)) {
27039  return -1;
27040  }
27041  return 0;
27042 }
27043 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
27044  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
27045  m->defaults = PyObject_Malloc(size);
27046  if (unlikely(!m->defaults))
27047  return PyErr_NoMemory();
27048  memset(m->defaults, 0, size);
27049  m->defaults_pyobjects = pyobjects;
27050  return m->defaults;
27051 }
27052 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
27053  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
27054  m->defaults_tuple = tuple;
27055  Py_INCREF(tuple);
27056 }
27057 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
27058  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
27059  m->defaults_kwdict = dict;
27060  Py_INCREF(dict);
27061 }
27062 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
27063  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
27064  m->func_annotations = dict;
27065  Py_INCREF(dict);
27066 }
27067 
27068 /* Py3ClassCreate */
27069  static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
27070  PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
27071  PyObject *ns;
27072  if (metaclass) {
27073  PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
27074  if (prep) {
27075  PyObject *pargs = PyTuple_Pack(2, name, bases);
27076  if (unlikely(!pargs)) {
27077  Py_DECREF(prep);
27078  return NULL;
27079  }
27080  ns = PyObject_Call(prep, pargs, mkw);
27081  Py_DECREF(prep);
27082  Py_DECREF(pargs);
27083  } else {
27084  if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
27085  return NULL;
27086  PyErr_Clear();
27087  ns = PyDict_New();
27088  }
27089  } else {
27090  ns = PyDict_New();
27091  }
27092  if (unlikely(!ns))
27093  return NULL;
27094  if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
27095  if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
27096  if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
27097  return ns;
27098 bad:
27099  Py_DECREF(ns);
27100  return NULL;
27101 }
27102 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
27103  PyObject *dict, PyObject *mkw,
27104  int calculate_metaclass, int allow_py2_metaclass) {
27105  PyObject *result, *margs;
27106  PyObject *owned_metaclass = NULL;
27107  if (allow_py2_metaclass) {
27108  owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
27109  if (owned_metaclass) {
27110  metaclass = owned_metaclass;
27111  } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
27112  PyErr_Clear();
27113  } else {
27114  return NULL;
27115  }
27116  }
27117  if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
27118  metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
27119  Py_XDECREF(owned_metaclass);
27120  if (unlikely(!metaclass))
27121  return NULL;
27122  owned_metaclass = metaclass;
27123  }
27124  margs = PyTuple_Pack(3, name, bases, dict);
27125  if (unlikely(!margs)) {
27126  result = NULL;
27127  } else {
27128  result = PyObject_Call(metaclass, margs, mkw);
27129  Py_DECREF(margs);
27130  }
27131  Py_XDECREF(owned_metaclass);
27132  return result;
27133 }
27134 
27135 /* CLineInTraceback */
27136  #ifndef CYTHON_CLINE_IN_TRACEBACK
27137 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) {
27138  PyObject *use_cline;
27139  PyObject *ptype, *pvalue, *ptraceback;
27140 #if CYTHON_COMPILING_IN_CPYTHON
27141  PyObject **cython_runtime_dict;
27142 #endif
27143  if (unlikely(!__pyx_cython_runtime)) {
27144  return c_line;
27145  }
27146  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
27147 #if CYTHON_COMPILING_IN_CPYTHON
27148  cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
27149  if (likely(cython_runtime_dict)) {
27150  use_cline = __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback);
27151  } else
27152 #endif
27153  {
27154  PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
27155  if (use_cline_obj) {
27156  use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
27157  Py_DECREF(use_cline_obj);
27158  } else {
27159  PyErr_Clear();
27160  use_cline = NULL;
27161  }
27162  }
27163  if (!use_cline) {
27164  c_line = 0;
27165  PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
27166  }
27167  else if (PyObject_Not(use_cline) != 0) {
27168  c_line = 0;
27169  }
27170  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
27171  return c_line;
27172 }
27173 #endif
27174 
27175 /* CodeObjectCache */
27176  static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
27177  int start = 0, mid = 0, end = count - 1;
27178  if (end >= 0 && code_line > entries[end].code_line) {
27179  return count;
27180  }
27181  while (start < end) {
27182  mid = start + (end - start) / 2;
27183  if (code_line < entries[mid].code_line) {
27184  end = mid;
27185  } else if (code_line > entries[mid].code_line) {
27186  start = mid + 1;
27187  } else {
27188  return mid;
27189  }
27190  }
27191  if (code_line <= entries[mid].code_line) {
27192  return mid;
27193  } else {
27194  return mid + 1;
27195  }
27196 }
27197 static PyCodeObject *__pyx_find_code_object(int code_line) {
27198  PyCodeObject* code_object;
27199  int pos;
27200  if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
27201  return NULL;
27202  }
27203  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
27204  if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
27205  return NULL;
27206  }
27207  code_object = __pyx_code_cache.entries[pos].code_object;
27208  Py_INCREF(code_object);
27209  return code_object;
27210 }
27211 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
27212  int pos, i;
27213  __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
27214  if (unlikely(!code_line)) {
27215  return;
27216  }
27217  if (unlikely(!entries)) {
27218  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
27219  if (likely(entries)) {
27220  __pyx_code_cache.entries = entries;
27221  __pyx_code_cache.max_count = 64;
27222  __pyx_code_cache.count = 1;
27223  entries[0].code_line = code_line;
27224  entries[0].code_object = code_object;
27225  Py_INCREF(code_object);
27226  }
27227  return;
27228  }
27229  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
27230  if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
27231  PyCodeObject* tmp = entries[pos].code_object;
27232  entries[pos].code_object = code_object;
27233  Py_DECREF(tmp);
27234  return;
27235  }
27236  if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
27237  int new_max = __pyx_code_cache.max_count + 64;
27238  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
27239  __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
27240  if (unlikely(!entries)) {
27241  return;
27242  }
27243  __pyx_code_cache.entries = entries;
27244  __pyx_code_cache.max_count = new_max;
27245  }
27246  for (i=__pyx_code_cache.count; i>pos; i--) {
27247  entries[i] = entries[i-1];
27248  }
27249  entries[pos].code_line = code_line;
27250  entries[pos].code_object = code_object;
27251  __pyx_code_cache.count++;
27252  Py_INCREF(code_object);
27253 }
27254 
27255 /* AddTraceback */
27256  #include "compile.h"
27257 #include "frameobject.h"
27258 #include "traceback.h"
27259 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
27260  const char *funcname, int c_line,
27261  int py_line, const char *filename) {
27262  PyCodeObject *py_code = 0;
27263  PyObject *py_srcfile = 0;
27264  PyObject *py_funcname = 0;
27265  #if PY_MAJOR_VERSION < 3
27266  py_srcfile = PyString_FromString(filename);
27267  #else
27268  py_srcfile = PyUnicode_FromString(filename);
27269  #endif
27270  if (!py_srcfile) goto bad;
27271  if (c_line) {
27272  #if PY_MAJOR_VERSION < 3
27273  py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
27274  #else
27275  py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
27276  #endif
27277  }
27278  else {
27279  #if PY_MAJOR_VERSION < 3
27280  py_funcname = PyString_FromString(funcname);
27281  #else
27282  py_funcname = PyUnicode_FromString(funcname);
27283  #endif
27284  }
27285  if (!py_funcname) goto bad;
27286  py_code = __Pyx_PyCode_New(
27287  0,
27288  0,
27289  0,
27290  0,
27291  0,
27292  __pyx_empty_bytes, /*PyObject *code,*/
27293  __pyx_empty_tuple, /*PyObject *consts,*/
27294  __pyx_empty_tuple, /*PyObject *names,*/
27295  __pyx_empty_tuple, /*PyObject *varnames,*/
27296  __pyx_empty_tuple, /*PyObject *freevars,*/
27297  __pyx_empty_tuple, /*PyObject *cellvars,*/
27298  py_srcfile, /*PyObject *filename,*/
27299  py_funcname, /*PyObject *name,*/
27300  py_line,
27301  __pyx_empty_bytes /*PyObject *lnotab*/
27302  );
27303  Py_DECREF(py_srcfile);
27304  Py_DECREF(py_funcname);
27305  return py_code;
27306 bad:
27307  Py_XDECREF(py_srcfile);
27308  Py_XDECREF(py_funcname);
27309  return NULL;
27310 }
27311 static void __Pyx_AddTraceback(const char *funcname, int c_line,
27312  int py_line, const char *filename) {
27313  PyCodeObject *py_code = 0;
27314  PyFrameObject *py_frame = 0;
27315  PyThreadState *tstate = __Pyx_PyThreadState_Current;
27316  if (c_line) {
27317  c_line = __Pyx_CLineForTraceback(tstate, c_line);
27318  }
27319  py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
27320  if (!py_code) {
27321  py_code = __Pyx_CreateCodeObjectForTraceback(
27322  funcname, c_line, py_line, filename);
27323  if (!py_code) goto bad;
27324  __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
27325  }
27326  py_frame = PyFrame_New(
27327  tstate, /*PyThreadState *tstate,*/
27328  py_code, /*PyCodeObject *code,*/
27329  __pyx_d, /*PyObject *globals,*/
27330  0 /*PyObject *locals*/
27331  );
27332  if (!py_frame) goto bad;
27333  __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
27334  PyTraceBack_Here(py_frame);
27335 bad:
27336  Py_XDECREF(py_code);
27337  Py_XDECREF(py_frame);
27338 }
27339 
27340 #if PY_MAJOR_VERSION < 3
27341 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
27342  if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
27343  if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
27344  if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
27345  if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
27346  PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
27347  return -1;
27348 }
27349 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
27350  PyObject *obj = view->obj;
27351  if (!obj) return;
27352  if (PyObject_CheckBuffer(obj)) {
27353  PyBuffer_Release(view);
27354  return;
27355  }
27356  if ((0)) {}
27357  else if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view);
27358  view->obj = NULL;
27359  Py_DECREF(obj);
27360 }
27361 #endif
27362 
27363 
27364  /* MemviewSliceIsContig */
27365  static int
27366 __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
27367 {
27368  int i, index, step, start;
27369  Py_ssize_t itemsize = mvs.memview->view.itemsize;
27370  if (order == 'F') {
27371  step = 1;
27372  start = 0;
27373  } else {
27374  step = -1;
27375  start = ndim - 1;
27376  }
27377  for (i = 0; i < ndim; i++) {
27378  index = start + step * i;
27379  if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
27380  return 0;
27381  itemsize *= mvs.shape[index];
27382  }
27383  return 1;
27384 }
27385 
27386 /* OverlappingSlices */
27387  static void
27388 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
27389  void **out_start, void **out_end,
27390  int ndim, size_t itemsize)
27391 {
27392  char *start, *end;
27393  int i;
27394  start = end = slice->data;
27395  for (i = 0; i < ndim; i++) {
27396  Py_ssize_t stride = slice->strides[i];
27397  Py_ssize_t extent = slice->shape[i];
27398  if (extent == 0) {
27399  *out_start = *out_end = start;
27400  return;
27401  } else {
27402  if (stride > 0)
27403  end += stride * (extent - 1);
27404  else
27405  start += stride * (extent - 1);
27406  }
27407  }
27408  *out_start = start;
27409  *out_end = end + itemsize;
27410 }
27411 static int
27412 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
27413  __Pyx_memviewslice *slice2,
27414  int ndim, size_t itemsize)
27415 {
27416  void *start1, *end1, *start2, *end2;
27417  __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
27418  __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
27419  return (start1 < end2) && (start2 < end1);
27420 }
27421 
27422 /* Capsule */
27423  static CYTHON_INLINE PyObject *
27424 __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
27425 {
27426  PyObject *cobj;
27427 #if PY_VERSION_HEX >= 0x02070000
27428  cobj = PyCapsule_New(p, sig, NULL);
27429 #else
27430  cobj = PyCObject_FromVoidPtr(p, NULL);
27431 #endif
27432  return cobj;
27433 }
27434 
27435 /* CIntFromPyVerify */
27436  #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
27437  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
27438 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
27439  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
27440 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
27441  {\
27442  func_type value = func_value;\
27443  if (sizeof(target_type) < sizeof(func_type)) {\
27444  if (unlikely(value != (func_type) (target_type) value)) {\
27445  func_type zero = 0;\
27446  if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
27447  return (target_type) -1;\
27448  if (is_unsigned && unlikely(value < zero))\
27449  goto raise_neg_overflow;\
27450  else\
27451  goto raise_overflow;\
27452  }\
27453  }\
27454  return (target_type) value;\
27455  }
27456 
27457 /* Declarations */
27458  #if CYTHON_CCOMPLEX
27459  #ifdef __cplusplus
27460  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
27461  return ::std::complex< float >(x, y);
27462  }
27463  #else
27464  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
27465  return x + y*(__pyx_t_float_complex)_Complex_I;
27466  }
27467  #endif
27468 #else
27469  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
27470  __pyx_t_float_complex z;
27471  z.real = x;
27472  z.imag = y;
27473  return z;
27474  }
27475 #endif
27476 
27477 /* Arithmetic */
27478  #if CYTHON_CCOMPLEX
27479 #else
27480  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27481  return (a.real == b.real) && (a.imag == b.imag);
27482  }
27483  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27484  __pyx_t_float_complex z;
27485  z.real = a.real + b.real;
27486  z.imag = a.imag + b.imag;
27487  return z;
27488  }
27489  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27490  __pyx_t_float_complex z;
27491  z.real = a.real - b.real;
27492  z.imag = a.imag - b.imag;
27493  return z;
27494  }
27495  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27496  __pyx_t_float_complex z;
27497  z.real = a.real * b.real - a.imag * b.imag;
27498  z.imag = a.real * b.imag + a.imag * b.real;
27499  return z;
27500  }
27501  #if 1
27502  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27503  if (b.imag == 0) {
27504  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
27505  } else if (fabsf(b.real) >= fabsf(b.imag)) {
27506  if (b.real == 0 && b.imag == 0) {
27507  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
27508  } else {
27509  float r = b.imag / b.real;
27510  float s = 1.0 / (b.real + b.imag * r);
27511  return __pyx_t_float_complex_from_parts(
27512  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
27513  }
27514  } else {
27515  float r = b.real / b.imag;
27516  float s = 1.0 / (b.imag + b.real * r);
27517  return __pyx_t_float_complex_from_parts(
27518  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
27519  }
27520  }
27521  #else
27522  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27523  if (b.imag == 0) {
27524  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
27525  } else {
27526  float denom = b.real * b.real + b.imag * b.imag;
27527  return __pyx_t_float_complex_from_parts(
27528  (a.real * b.real + a.imag * b.imag) / denom,
27529  (a.imag * b.real - a.real * b.imag) / denom);
27530  }
27531  }
27532  #endif
27533  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
27534  __pyx_t_float_complex z;
27535  z.real = -a.real;
27536  z.imag = -a.imag;
27537  return z;
27538  }
27539  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
27540  return (a.real == 0) && (a.imag == 0);
27541  }
27542  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
27543  __pyx_t_float_complex z;
27544  z.real = a.real;
27545  z.imag = -a.imag;
27546  return z;
27547  }
27548  #if 1
27549  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
27550  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
27551  return sqrtf(z.real*z.real + z.imag*z.imag);
27552  #else
27553  return hypotf(z.real, z.imag);
27554  #endif
27555  }
27556  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27557  __pyx_t_float_complex z;
27558  float r, lnr, theta, z_r, z_theta;
27559  if (b.imag == 0 && b.real == (int)b.real) {
27560  if (b.real < 0) {
27561  float denom = a.real * a.real + a.imag * a.imag;
27562  a.real = a.real / denom;
27563  a.imag = -a.imag / denom;
27564  b.real = -b.real;
27565  }
27566  switch ((int)b.real) {
27567  case 0:
27568  z.real = 1;
27569  z.imag = 0;
27570  return z;
27571  case 1:
27572  return a;
27573  case 2:
27574  z = __Pyx_c_prod_float(a, a);
27575  return __Pyx_c_prod_float(a, a);
27576  case 3:
27577  z = __Pyx_c_prod_float(a, a);
27578  return __Pyx_c_prod_float(z, a);
27579  case 4:
27580  z = __Pyx_c_prod_float(a, a);
27581  return __Pyx_c_prod_float(z, z);
27582  }
27583  }
27584  if (a.imag == 0) {
27585  if (a.real == 0) {
27586  return a;
27587  } else if (b.imag == 0) {
27588  z.real = powf(a.real, b.real);
27589  z.imag = 0;
27590  return z;
27591  } else if (a.real > 0) {
27592  r = a.real;
27593  theta = 0;
27594  } else {
27595  r = -a.real;
27596  theta = atan2f(0, -1);
27597  }
27598  } else {
27599  r = __Pyx_c_abs_float(a);
27600  theta = atan2f(a.imag, a.real);
27601  }
27602  lnr = logf(r);
27603  z_r = expf(lnr * b.real - theta * b.imag);
27604  z_theta = theta * b.real + lnr * b.imag;
27605  z.real = z_r * cosf(z_theta);
27606  z.imag = z_r * sinf(z_theta);
27607  return z;
27608  }
27609  #endif
27610 #endif
27611 
27612 /* Declarations */
27613  #if CYTHON_CCOMPLEX
27614  #ifdef __cplusplus
27615  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
27616  return ::std::complex< double >(x, y);
27617  }
27618  #else
27619  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
27620  return x + y*(__pyx_t_double_complex)_Complex_I;
27621  }
27622  #endif
27623 #else
27624  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
27625  __pyx_t_double_complex z;
27626  z.real = x;
27627  z.imag = y;
27628  return z;
27629  }
27630 #endif
27631 
27632 /* Arithmetic */
27633  #if CYTHON_CCOMPLEX
27634 #else
27635  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27636  return (a.real == b.real) && (a.imag == b.imag);
27637  }
27638  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27639  __pyx_t_double_complex z;
27640  z.real = a.real + b.real;
27641  z.imag = a.imag + b.imag;
27642  return z;
27643  }
27644  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27645  __pyx_t_double_complex z;
27646  z.real = a.real - b.real;
27647  z.imag = a.imag - b.imag;
27648  return z;
27649  }
27650  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27651  __pyx_t_double_complex z;
27652  z.real = a.real * b.real - a.imag * b.imag;
27653  z.imag = a.real * b.imag + a.imag * b.real;
27654  return z;
27655  }
27656  #if 1
27657  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27658  if (b.imag == 0) {
27659  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
27660  } else if (fabs(b.real) >= fabs(b.imag)) {
27661  if (b.real == 0 && b.imag == 0) {
27662  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
27663  } else {
27664  double r = b.imag / b.real;
27665  double s = 1.0 / (b.real + b.imag * r);
27666  return __pyx_t_double_complex_from_parts(
27667  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
27668  }
27669  } else {
27670  double r = b.real / b.imag;
27671  double s = 1.0 / (b.imag + b.real * r);
27672  return __pyx_t_double_complex_from_parts(
27673  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
27674  }
27675  }
27676  #else
27677  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27678  if (b.imag == 0) {
27679  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
27680  } else {
27681  double denom = b.real * b.real + b.imag * b.imag;
27682  return __pyx_t_double_complex_from_parts(
27683  (a.real * b.real + a.imag * b.imag) / denom,
27684  (a.imag * b.real - a.real * b.imag) / denom);
27685  }
27686  }
27687  #endif
27688  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
27689  __pyx_t_double_complex z;
27690  z.real = -a.real;
27691  z.imag = -a.imag;
27692  return z;
27693  }
27694  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
27695  return (a.real == 0) && (a.imag == 0);
27696  }
27697  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
27698  __pyx_t_double_complex z;
27699  z.real = a.real;
27700  z.imag = -a.imag;
27701  return z;
27702  }
27703  #if 1
27704  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
27705  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
27706  return sqrt(z.real*z.real + z.imag*z.imag);
27707  #else
27708  return hypot(z.real, z.imag);
27709  #endif
27710  }
27711  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27712  __pyx_t_double_complex z;
27713  double r, lnr, theta, z_r, z_theta;
27714  if (b.imag == 0 && b.real == (int)b.real) {
27715  if (b.real < 0) {
27716  double denom = a.real * a.real + a.imag * a.imag;
27717  a.real = a.real / denom;
27718  a.imag = -a.imag / denom;
27719  b.real = -b.real;
27720  }
27721  switch ((int)b.real) {
27722  case 0:
27723  z.real = 1;
27724  z.imag = 0;
27725  return z;
27726  case 1:
27727  return a;
27728  case 2:
27729  z = __Pyx_c_prod_double(a, a);
27730  return __Pyx_c_prod_double(a, a);
27731  case 3:
27732  z = __Pyx_c_prod_double(a, a);
27733  return __Pyx_c_prod_double(z, a);
27734  case 4:
27735  z = __Pyx_c_prod_double(a, a);
27736  return __Pyx_c_prod_double(z, z);
27737  }
27738  }
27739  if (a.imag == 0) {
27740  if (a.real == 0) {
27741  return a;
27742  } else if (b.imag == 0) {
27743  z.real = pow(a.real, b.real);
27744  z.imag = 0;
27745  return z;
27746  } else if (a.real > 0) {
27747  r = a.real;
27748  theta = 0;
27749  } else {
27750  r = -a.real;
27751  theta = atan2(0, -1);
27752  }
27753  } else {
27754  r = __Pyx_c_abs_double(a);
27755  theta = atan2(a.imag, a.real);
27756  }
27757  lnr = log(r);
27758  z_r = exp(lnr * b.real - theta * b.imag);
27759  z_theta = theta * b.real + lnr * b.imag;
27760  z.real = z_r * cos(z_theta);
27761  z.imag = z_r * sin(z_theta);
27762  return z;
27763  }
27764  #endif
27765 #endif
27766 
27767 /* CIntToPy */
27768  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
27769  const int neg_one = (int) -1, const_zero = (int) 0;
27770  const int is_unsigned = neg_one > const_zero;
27771  if (is_unsigned) {
27772  if (sizeof(int) < sizeof(long)) {
27773  return PyInt_FromLong((long) value);
27774  } else if (sizeof(int) <= sizeof(unsigned long)) {
27775  return PyLong_FromUnsignedLong((unsigned long) value);
27776 #ifdef HAVE_LONG_LONG
27777  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
27778  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
27779 #endif
27780  }
27781  } else {
27782  if (sizeof(int) <= sizeof(long)) {
27783  return PyInt_FromLong((long) value);
27784 #ifdef HAVE_LONG_LONG
27785  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
27786  return PyLong_FromLongLong((PY_LONG_LONG) value);
27787 #endif
27788  }
27789  }
27790  {
27791  int one = 1; int little = (int)*(unsigned char *)&one;
27792  unsigned char *bytes = (unsigned char *)&value;
27793  return _PyLong_FromByteArray(bytes, sizeof(int),
27794  little, !is_unsigned);
27795  }
27796 }
27797 
27798 /* CIntToPy */
27799  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
27800  const enum NPY_TYPES neg_one = (enum NPY_TYPES) -1, const_zero = (enum NPY_TYPES) 0;
27801  const int is_unsigned = neg_one > const_zero;
27802  if (is_unsigned) {
27803  if (sizeof(enum NPY_TYPES) < sizeof(long)) {
27804  return PyInt_FromLong((long) value);
27805  } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
27806  return PyLong_FromUnsignedLong((unsigned long) value);
27807 #ifdef HAVE_LONG_LONG
27808  } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
27809  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
27810 #endif
27811  }
27812  } else {
27813  if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
27814  return PyInt_FromLong((long) value);
27815 #ifdef HAVE_LONG_LONG
27816  } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
27817  return PyLong_FromLongLong((PY_LONG_LONG) value);
27818 #endif
27819  }
27820  }
27821  {
27822  int one = 1; int little = (int)*(unsigned char *)&one;
27823  unsigned char *bytes = (unsigned char *)&value;
27824  return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
27825  little, !is_unsigned);
27826  }
27827 }
27828 
27829 /* MemviewSliceCopyTemplate */
27830  static __Pyx_memviewslice
27831 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
27832  const char *mode, int ndim,
27833  size_t sizeof_dtype, int contig_flag,
27834  int dtype_is_object)
27835 {
27836  __Pyx_RefNannyDeclarations
27837  int i;
27838  __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
27839  struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
27840  Py_buffer *buf = &from_memview->view;
27841  PyObject *shape_tuple = NULL;
27842  PyObject *temp_int = NULL;
27843  struct __pyx_array_obj *array_obj = NULL;
27844  struct __pyx_memoryview_obj *memview_obj = NULL;
27845  __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
27846  for (i = 0; i < ndim; i++) {
27847  if (from_mvs->suboffsets[i] >= 0) {
27848  PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
27849  "indirect dimensions (axis %d)", i);
27850  goto fail;
27851  }
27852  }
27853  shape_tuple = PyTuple_New(ndim);
27854  if (unlikely(!shape_tuple)) {
27855  goto fail;
27856  }
27857  __Pyx_GOTREF(shape_tuple);
27858  for(i = 0; i < ndim; i++) {
27859  temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
27860  if(unlikely(!temp_int)) {
27861  goto fail;
27862  } else {
27863  PyTuple_SET_ITEM(shape_tuple, i, temp_int);
27864  temp_int = NULL;
27865  }
27866  }
27867  array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
27868  if (unlikely(!array_obj)) {
27869  goto fail;
27870  }
27871  __Pyx_GOTREF(array_obj);
27872  memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
27873  (PyObject *) array_obj, contig_flag,
27874  dtype_is_object,
27875  from_mvs->memview->typeinfo);
27876  if (unlikely(!memview_obj))
27877  goto fail;
27878  if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
27879  goto fail;
27880  if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
27881  dtype_is_object) < 0))
27882  goto fail;
27883  goto no_fail;
27884 fail:
27885  __Pyx_XDECREF(new_mvs.memview);
27886  new_mvs.memview = NULL;
27887  new_mvs.data = NULL;
27888 no_fail:
27889  __Pyx_XDECREF(shape_tuple);
27890  __Pyx_XDECREF(temp_int);
27891  __Pyx_XDECREF(array_obj);
27892  __Pyx_RefNannyFinishContext();
27893  return new_mvs;
27894 }
27895 
27896 /* CIntFromPy */
27897  static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
27898  const int neg_one = (int) -1, const_zero = (int) 0;
27899  const int is_unsigned = neg_one > const_zero;
27900 #if PY_MAJOR_VERSION < 3
27901  if (likely(PyInt_Check(x))) {
27902  if (sizeof(int) < sizeof(long)) {
27903  __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
27904  } else {
27905  long val = PyInt_AS_LONG(x);
27906  if (is_unsigned && unlikely(val < 0)) {
27907  goto raise_neg_overflow;
27908  }
27909  return (int) val;
27910  }
27911  } else
27912 #endif
27913  if (likely(PyLong_Check(x))) {
27914  if (is_unsigned) {
27915 #if CYTHON_USE_PYLONG_INTERNALS
27916  const digit* digits = ((PyLongObject*)x)->ob_digit;
27917  switch (Py_SIZE(x)) {
27918  case 0: return (int) 0;
27919  case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
27920  case 2:
27921  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
27922  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27923  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27924  } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
27925  return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
27926  }
27927  }
27928  break;
27929  case 3:
27930  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
27931  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27932  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27933  } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
27934  return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
27935  }
27936  }
27937  break;
27938  case 4:
27939  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
27940  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27941  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27942  } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
27943  return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
27944  }
27945  }
27946  break;
27947  }
27948 #endif
27949 #if CYTHON_COMPILING_IN_CPYTHON
27950  if (unlikely(Py_SIZE(x) < 0)) {
27951  goto raise_neg_overflow;
27952  }
27953 #else
27954  {
27955  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27956  if (unlikely(result < 0))
27957  return (int) -1;
27958  if (unlikely(result == 1))
27959  goto raise_neg_overflow;
27960  }
27961 #endif
27962  if (sizeof(int) <= sizeof(unsigned long)) {
27963  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
27964 #ifdef HAVE_LONG_LONG
27965  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
27966  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27967 #endif
27968  }
27969  } else {
27970 #if CYTHON_USE_PYLONG_INTERNALS
27971  const digit* digits = ((PyLongObject*)x)->ob_digit;
27972  switch (Py_SIZE(x)) {
27973  case 0: return (int) 0;
27974  case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
27975  case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
27976  case -2:
27977  if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
27978  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27979  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27980  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
27981  return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27982  }
27983  }
27984  break;
27985  case 2:
27986  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
27987  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27988  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27989  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
27990  return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27991  }
27992  }
27993  break;
27994  case -3:
27995  if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
27996  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27997  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27998  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
27999  return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28000  }
28001  }
28002  break;
28003  case 3:
28004  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
28005  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28006  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28007  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
28008  return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28009  }
28010  }
28011  break;
28012  case -4:
28013  if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
28014  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28015  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28016  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
28017  return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28018  }
28019  }
28020  break;
28021  case 4:
28022  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
28023  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28024  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28025  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
28026  return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28027  }
28028  }
28029  break;
28030  }
28031 #endif
28032  if (sizeof(int) <= sizeof(long)) {
28033  __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
28034 #ifdef HAVE_LONG_LONG
28035  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
28036  __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
28037 #endif
28038  }
28039  }
28040  {
28041 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28042  PyErr_SetString(PyExc_RuntimeError,
28043  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28044 #else
28045  int val;
28046  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28047  #if PY_MAJOR_VERSION < 3
28048  if (likely(v) && !PyLong_Check(v)) {
28049  PyObject *tmp = v;
28050  v = PyNumber_Long(tmp);
28051  Py_DECREF(tmp);
28052  }
28053  #endif
28054  if (likely(v)) {
28055  int one = 1; int is_little = (int)*(unsigned char *)&one;
28056  unsigned char *bytes = (unsigned char *)&val;
28057  int ret = _PyLong_AsByteArray((PyLongObject *)v,
28058  bytes, sizeof(val),
28059  is_little, !is_unsigned);
28060  Py_DECREF(v);
28061  if (likely(!ret))
28062  return val;
28063  }
28064 #endif
28065  return (int) -1;
28066  }
28067  } else {
28068  int val;
28069  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28070  if (!tmp) return (int) -1;
28071  val = __Pyx_PyInt_As_int(tmp);
28072  Py_DECREF(tmp);
28073  return val;
28074  }
28075 raise_overflow:
28076  PyErr_SetString(PyExc_OverflowError,
28077  "value too large to convert to int");
28078  return (int) -1;
28079 raise_neg_overflow:
28080  PyErr_SetString(PyExc_OverflowError,
28081  "can't convert negative value to int");
28082  return (int) -1;
28083 }
28084 
28085 /* CIntFromPy */
28086  static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
28087  const long neg_one = (long) -1, const_zero = (long) 0;
28088  const int is_unsigned = neg_one > const_zero;
28089 #if PY_MAJOR_VERSION < 3
28090  if (likely(PyInt_Check(x))) {
28091  if (sizeof(long) < sizeof(long)) {
28092  __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
28093  } else {
28094  long val = PyInt_AS_LONG(x);
28095  if (is_unsigned && unlikely(val < 0)) {
28096  goto raise_neg_overflow;
28097  }
28098  return (long) val;
28099  }
28100  } else
28101 #endif
28102  if (likely(PyLong_Check(x))) {
28103  if (is_unsigned) {
28104 #if CYTHON_USE_PYLONG_INTERNALS
28105  const digit* digits = ((PyLongObject*)x)->ob_digit;
28106  switch (Py_SIZE(x)) {
28107  case 0: return (long) 0;
28108  case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
28109  case 2:
28110  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
28111  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28112  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28113  } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
28114  return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28115  }
28116  }
28117  break;
28118  case 3:
28119  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
28120  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28121  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28122  } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
28123  return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28124  }
28125  }
28126  break;
28127  case 4:
28128  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
28129  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28130  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28131  } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
28132  return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28133  }
28134  }
28135  break;
28136  }
28137 #endif
28138 #if CYTHON_COMPILING_IN_CPYTHON
28139  if (unlikely(Py_SIZE(x) < 0)) {
28140  goto raise_neg_overflow;
28141  }
28142 #else
28143  {
28144  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28145  if (unlikely(result < 0))
28146  return (long) -1;
28147  if (unlikely(result == 1))
28148  goto raise_neg_overflow;
28149  }
28150 #endif
28151  if (sizeof(long) <= sizeof(unsigned long)) {
28152  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
28153 #ifdef HAVE_LONG_LONG
28154  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
28155  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28156 #endif
28157  }
28158  } else {
28159 #if CYTHON_USE_PYLONG_INTERNALS
28160  const digit* digits = ((PyLongObject*)x)->ob_digit;
28161  switch (Py_SIZE(x)) {
28162  case 0: return (long) 0;
28163  case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
28164  case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
28165  case -2:
28166  if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
28167  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28168  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28169  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
28170  return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28171  }
28172  }
28173  break;
28174  case 2:
28175  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
28176  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28177  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28178  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
28179  return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28180  }
28181  }
28182  break;
28183  case -3:
28184  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
28185  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28186  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28187  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
28188  return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28189  }
28190  }
28191  break;
28192  case 3:
28193  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
28194  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28195  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28196  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
28197  return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28198  }
28199  }
28200  break;
28201  case -4:
28202  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
28203  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28204  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28205  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
28206  return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28207  }
28208  }
28209  break;
28210  case 4:
28211  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
28212  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28213  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28214  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
28215  return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28216  }
28217  }
28218  break;
28219  }
28220 #endif
28221  if (sizeof(long) <= sizeof(long)) {
28222  __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
28223 #ifdef HAVE_LONG_LONG
28224  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
28225  __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
28226 #endif
28227  }
28228  }
28229  {
28230 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28231  PyErr_SetString(PyExc_RuntimeError,
28232  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28233 #else
28234  long val;
28235  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28236  #if PY_MAJOR_VERSION < 3
28237  if (likely(v) && !PyLong_Check(v)) {
28238  PyObject *tmp = v;
28239  v = PyNumber_Long(tmp);
28240  Py_DECREF(tmp);
28241  }
28242  #endif
28243  if (likely(v)) {
28244  int one = 1; int is_little = (int)*(unsigned char *)&one;
28245  unsigned char *bytes = (unsigned char *)&val;
28246  int ret = _PyLong_AsByteArray((PyLongObject *)v,
28247  bytes, sizeof(val),
28248  is_little, !is_unsigned);
28249  Py_DECREF(v);
28250  if (likely(!ret))
28251  return val;
28252  }
28253 #endif
28254  return (long) -1;
28255  }
28256  } else {
28257  long val;
28258  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28259  if (!tmp) return (long) -1;
28260  val = __Pyx_PyInt_As_long(tmp);
28261  Py_DECREF(tmp);
28262  return val;
28263  }
28264 raise_overflow:
28265  PyErr_SetString(PyExc_OverflowError,
28266  "value too large to convert to long");
28267  return (long) -1;
28268 raise_neg_overflow:
28269  PyErr_SetString(PyExc_OverflowError,
28270  "can't convert negative value to long");
28271  return (long) -1;
28272 }
28273 
28274 /* CIntToPy */
28275  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
28276  const long neg_one = (long) -1, const_zero = (long) 0;
28277  const int is_unsigned = neg_one > const_zero;
28278  if (is_unsigned) {
28279  if (sizeof(long) < sizeof(long)) {
28280  return PyInt_FromLong((long) value);
28281  } else if (sizeof(long) <= sizeof(unsigned long)) {
28282  return PyLong_FromUnsignedLong((unsigned long) value);
28283 #ifdef HAVE_LONG_LONG
28284  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
28285  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
28286 #endif
28287  }
28288  } else {
28289  if (sizeof(long) <= sizeof(long)) {
28290  return PyInt_FromLong((long) value);
28291 #ifdef HAVE_LONG_LONG
28292  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
28293  return PyLong_FromLongLong((PY_LONG_LONG) value);
28294 #endif
28295  }
28296  }
28297  {
28298  int one = 1; int little = (int)*(unsigned char *)&one;
28299  unsigned char *bytes = (unsigned char *)&value;
28300  return _PyLong_FromByteArray(bytes, sizeof(long),
28301  little, !is_unsigned);
28302  }
28303 }
28304 
28305 /* CIntFromPy */
28306  static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
28307  const char neg_one = (char) -1, const_zero = (char) 0;
28308  const int is_unsigned = neg_one > const_zero;
28309 #if PY_MAJOR_VERSION < 3
28310  if (likely(PyInt_Check(x))) {
28311  if (sizeof(char) < sizeof(long)) {
28312  __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
28313  } else {
28314  long val = PyInt_AS_LONG(x);
28315  if (is_unsigned && unlikely(val < 0)) {
28316  goto raise_neg_overflow;
28317  }
28318  return (char) val;
28319  }
28320  } else
28321 #endif
28322  if (likely(PyLong_Check(x))) {
28323  if (is_unsigned) {
28324 #if CYTHON_USE_PYLONG_INTERNALS
28325  const digit* digits = ((PyLongObject*)x)->ob_digit;
28326  switch (Py_SIZE(x)) {
28327  case 0: return (char) 0;
28328  case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
28329  case 2:
28330  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
28331  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28332  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28333  } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
28334  return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28335  }
28336  }
28337  break;
28338  case 3:
28339  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
28340  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28341  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28342  } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
28343  return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28344  }
28345  }
28346  break;
28347  case 4:
28348  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
28349  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28350  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28351  } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
28352  return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28353  }
28354  }
28355  break;
28356  }
28357 #endif
28358 #if CYTHON_COMPILING_IN_CPYTHON
28359  if (unlikely(Py_SIZE(x) < 0)) {
28360  goto raise_neg_overflow;
28361  }
28362 #else
28363  {
28364  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28365  if (unlikely(result < 0))
28366  return (char) -1;
28367  if (unlikely(result == 1))
28368  goto raise_neg_overflow;
28369  }
28370 #endif
28371  if (sizeof(char) <= sizeof(unsigned long)) {
28372  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
28373 #ifdef HAVE_LONG_LONG
28374  } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
28375  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28376 #endif
28377  }
28378  } else {
28379 #if CYTHON_USE_PYLONG_INTERNALS
28380  const digit* digits = ((PyLongObject*)x)->ob_digit;
28381  switch (Py_SIZE(x)) {
28382  case 0: return (char) 0;
28383  case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
28384  case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0])
28385  case -2:
28386  if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
28387  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28388  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28389  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
28390  return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28391  }
28392  }
28393  break;
28394  case 2:
28395  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
28396  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28397  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28398  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
28399  return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28400  }
28401  }
28402  break;
28403  case -3:
28404  if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
28405  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28406  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28407  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
28408  return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28409  }
28410  }
28411  break;
28412  case 3:
28413  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
28414  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28415  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28416  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
28417  return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28418  }
28419  }
28420  break;
28421  case -4:
28422  if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
28423  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28424  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28425  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
28426  return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28427  }
28428  }
28429  break;
28430  case 4:
28431  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
28432  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28433  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28434  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
28435  return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28436  }
28437  }
28438  break;
28439  }
28440 #endif
28441  if (sizeof(char) <= sizeof(long)) {
28442  __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
28443 #ifdef HAVE_LONG_LONG
28444  } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
28445  __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
28446 #endif
28447  }
28448  }
28449  {
28450 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28451  PyErr_SetString(PyExc_RuntimeError,
28452  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28453 #else
28454  char val;
28455  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28456  #if PY_MAJOR_VERSION < 3
28457  if (likely(v) && !PyLong_Check(v)) {
28458  PyObject *tmp = v;
28459  v = PyNumber_Long(tmp);
28460  Py_DECREF(tmp);
28461  }
28462  #endif
28463  if (likely(v)) {
28464  int one = 1; int is_little = (int)*(unsigned char *)&one;
28465  unsigned char *bytes = (unsigned char *)&val;
28466  int ret = _PyLong_AsByteArray((PyLongObject *)v,
28467  bytes, sizeof(val),
28468  is_little, !is_unsigned);
28469  Py_DECREF(v);
28470  if (likely(!ret))
28471  return val;
28472  }
28473 #endif
28474  return (char) -1;
28475  }
28476  } else {
28477  char val;
28478  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28479  if (!tmp) return (char) -1;
28480  val = __Pyx_PyInt_As_char(tmp);
28481  Py_DECREF(tmp);
28482  return val;
28483  }
28484 raise_overflow:
28485  PyErr_SetString(PyExc_OverflowError,
28486  "value too large to convert to char");
28487  return (char) -1;
28488 raise_neg_overflow:
28489  PyErr_SetString(PyExc_OverflowError,
28490  "can't convert negative value to char");
28491  return (char) -1;
28492 }
28493 
28494 /* IsLittleEndian */
28495  static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
28496 {
28497  union {
28498  uint32_t u32;
28499  uint8_t u8[4];
28500  } S;
28501  S.u32 = 0x01020304;
28502  return S.u8[0] == 4;
28503 }
28504 
28505 /* BufferFormatCheck */
28506  static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
28507  __Pyx_BufFmt_StackElem* stack,
28508  __Pyx_TypeInfo* type) {
28509  stack[0].field = &ctx->root;
28510  stack[0].parent_offset = 0;
28511  ctx->root.type = type;
28512  ctx->root.name = "buffer dtype";
28513  ctx->root.offset = 0;
28514  ctx->head = stack;
28515  ctx->head->field = &ctx->root;
28516  ctx->fmt_offset = 0;
28517  ctx->head->parent_offset = 0;
28518  ctx->new_packmode = '@';
28519  ctx->enc_packmode = '@';
28520  ctx->new_count = 1;
28521  ctx->enc_count = 0;
28522  ctx->enc_type = 0;
28523  ctx->is_complex = 0;
28524  ctx->is_valid_array = 0;
28525  ctx->struct_alignment = 0;
28526  while (type->typegroup == 'S') {
28527  ++ctx->head;
28528  ctx->head->field = type->fields;
28529  ctx->head->parent_offset = 0;
28530  type = type->fields->type;
28531  }
28532 }
28533 static int __Pyx_BufFmt_ParseNumber(const char** ts) {
28534  int count;
28535  const char* t = *ts;
28536  if (*t < '0' || *t > '9') {
28537  return -1;
28538  } else {
28539  count = *t++ - '0';
28540  while (*t >= '0' && *t < '9') {
28541  count *= 10;
28542  count += *t++ - '0';
28543  }
28544  }
28545  *ts = t;
28546  return count;
28547 }
28548 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
28549  int number = __Pyx_BufFmt_ParseNumber(ts);
28550  if (number == -1)
28551  PyErr_Format(PyExc_ValueError,\
28552  "Does not understand character buffer dtype format string ('%c')", **ts);
28553  return number;
28554 }
28555 static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
28556  PyErr_Format(PyExc_ValueError,
28557  "Unexpected format string character: '%c'", ch);
28558 }
28559 static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
28560  switch (ch) {
28561  case 'c': return "'char'";
28562  case 'b': return "'signed char'";
28563  case 'B': return "'unsigned char'";
28564  case 'h': return "'short'";
28565  case 'H': return "'unsigned short'";
28566  case 'i': return "'int'";
28567  case 'I': return "'unsigned int'";
28568  case 'l': return "'long'";
28569  case 'L': return "'unsigned long'";
28570  case 'q': return "'long long'";
28571  case 'Q': return "'unsigned long long'";
28572  case 'f': return (is_complex ? "'complex float'" : "'float'");
28573  case 'd': return (is_complex ? "'complex double'" : "'double'");
28574  case 'g': return (is_complex ? "'complex long double'" : "'long double'");
28575  case 'T': return "a struct";
28576  case 'O': return "Python object";
28577  case 'P': return "a pointer";
28578  case 's': case 'p': return "a string";
28579  case 0: return "end";
28580  default: return "unparseable format string";
28581  }
28582 }
28583 static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
28584  switch (ch) {
28585  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
28586  case 'h': case 'H': return 2;
28587  case 'i': case 'I': case 'l': case 'L': return 4;
28588  case 'q': case 'Q': return 8;
28589  case 'f': return (is_complex ? 8 : 4);
28590  case 'd': return (is_complex ? 16 : 8);
28591  case 'g': {
28592  PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
28593  return 0;
28594  }
28595  case 'O': case 'P': return sizeof(void*);
28596  default:
28597  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
28598  return 0;
28599  }
28600 }
28601 static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
28602  switch (ch) {
28603  case 'c': case 'b': case 'B': case 's': case 'p': return 1;
28604  case 'h': case 'H': return sizeof(short);
28605  case 'i': case 'I': return sizeof(int);
28606  case 'l': case 'L': return sizeof(long);
28607  #ifdef HAVE_LONG_LONG
28608  case 'q': case 'Q': return sizeof(PY_LONG_LONG);
28609  #endif
28610  case 'f': return sizeof(float) * (is_complex ? 2 : 1);
28611  case 'd': return sizeof(double) * (is_complex ? 2 : 1);
28612  case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
28613  case 'O': case 'P': return sizeof(void*);
28614  default: {
28615  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
28616  return 0;
28617  }
28618  }
28619 }
28620 typedef struct { char c; short x; } __Pyx_st_short;
28621 typedef struct { char c; int x; } __Pyx_st_int;
28622 typedef struct { char c; long x; } __Pyx_st_long;
28623 typedef struct { char c; float x; } __Pyx_st_float;
28624 typedef struct { char c; double x; } __Pyx_st_double;
28625 typedef struct { char c; long double x; } __Pyx_st_longdouble;
28626 typedef struct { char c; void *x; } __Pyx_st_void_p;
28627 #ifdef HAVE_LONG_LONG
28628 typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
28629 #endif
28630 static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
28631  switch (ch) {
28632  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
28633  case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
28634  case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
28635  case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
28636 #ifdef HAVE_LONG_LONG
28637  case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
28638 #endif
28639  case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
28640  case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
28641  case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
28642  case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
28643  default:
28644  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
28645  return 0;
28646  }
28647 }
28648 /* These are for computing the padding at the end of the struct to align
28649  on the first member of the struct. This will probably the same as above,
28650  but we don't have any guarantees.
28651  */
28652 typedef struct { short x; char c; } __Pyx_pad_short;
28653 typedef struct { int x; char c; } __Pyx_pad_int;
28654 typedef struct { long x; char c; } __Pyx_pad_long;
28655 typedef struct { float x; char c; } __Pyx_pad_float;
28656 typedef struct { double x; char c; } __Pyx_pad_double;
28657 typedef struct { long double x; char c; } __Pyx_pad_longdouble;
28658 typedef struct { void *x; char c; } __Pyx_pad_void_p;
28659 #ifdef HAVE_LONG_LONG
28660 typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
28661 #endif
28662 static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
28663  switch (ch) {
28664  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
28665  case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
28666  case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
28667  case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
28668 #ifdef HAVE_LONG_LONG
28669  case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
28670 #endif
28671  case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
28672  case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
28673  case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
28674  case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
28675  default:
28676  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
28677  return 0;
28678  }
28679 }
28680 static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
28681  switch (ch) {
28682  case 'c':
28683  return 'H';
28684  case 'b': case 'h': case 'i':
28685  case 'l': case 'q': case 's': case 'p':
28686  return 'I';
28687  case 'B': case 'H': case 'I': case 'L': case 'Q':
28688  return 'U';
28689  case 'f': case 'd': case 'g':
28690  return (is_complex ? 'C' : 'R');
28691  case 'O':
28692  return 'O';
28693  case 'P':
28694  return 'P';
28695  default: {
28696  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
28697  return 0;
28698  }
28699  }
28700 }
28701 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
28702  if (ctx->head == NULL || ctx->head->field == &ctx->root) {
28703  const char* expected;
28704  const char* quote;
28705  if (ctx->head == NULL) {
28706  expected = "end";
28707  quote = "";
28708  } else {
28709  expected = ctx->head->field->type->name;
28710  quote = "'";
28711  }
28712  PyErr_Format(PyExc_ValueError,
28713  "Buffer dtype mismatch, expected %s%s%s but got %s",
28714  quote, expected, quote,
28715  __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
28716  } else {
28717  __Pyx_StructField* field = ctx->head->field;
28718  __Pyx_StructField* parent = (ctx->head - 1)->field;
28719  PyErr_Format(PyExc_ValueError,
28720  "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
28721  field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
28722  parent->type->name, field->name);
28723  }
28724 }
28725 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
28726  char group;
28727  size_t size, offset, arraysize = 1;
28728  if (ctx->enc_type == 0) return 0;
28729  if (ctx->head->field->type->arraysize[0]) {
28730  int i, ndim = 0;
28731  if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
28732  ctx->is_valid_array = ctx->head->field->type->ndim == 1;
28733  ndim = 1;
28734  if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
28735  PyErr_Format(PyExc_ValueError,
28736  "Expected a dimension of size %zu, got %zu",
28737  ctx->head->field->type->arraysize[0], ctx->enc_count);
28738  return -1;
28739  }
28740  }
28741  if (!ctx->is_valid_array) {
28742  PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
28743  ctx->head->field->type->ndim, ndim);
28744  return -1;
28745  }
28746  for (i = 0; i < ctx->head->field->type->ndim; i++) {
28747  arraysize *= ctx->head->field->type->arraysize[i];
28748  }
28749  ctx->is_valid_array = 0;
28750  ctx->enc_count = 1;
28751  }
28752  group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
28753  do {
28754  __Pyx_StructField* field = ctx->head->field;
28755  __Pyx_TypeInfo* type = field->type;
28756  if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
28757  size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
28758  } else {
28759  size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
28760  }
28761  if (ctx->enc_packmode == '@') {
28762  size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
28763  size_t align_mod_offset;
28764  if (align_at == 0) return -1;
28765  align_mod_offset = ctx->fmt_offset % align_at;
28766  if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
28767  if (ctx->struct_alignment == 0)
28768  ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
28769  ctx->is_complex);
28770  }
28771  if (type->size != size || type->typegroup != group) {
28772  if (type->typegroup == 'C' && type->fields != NULL) {
28773  size_t parent_offset = ctx->head->parent_offset + field->offset;
28774  ++ctx->head;
28775  ctx->head->field = type->fields;
28776  ctx->head->parent_offset = parent_offset;
28777  continue;
28778  }
28779  if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
28780  } else {
28781  __Pyx_BufFmt_RaiseExpected(ctx);
28782  return -1;
28783  }
28784  }
28785  offset = ctx->head->parent_offset + field->offset;
28786  if (ctx->fmt_offset != offset) {
28787  PyErr_Format(PyExc_ValueError,
28788  "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
28789  (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
28790  return -1;
28791  }
28792  ctx->fmt_offset += size;
28793  if (arraysize)
28794  ctx->fmt_offset += (arraysize - 1) * size;
28795  --ctx->enc_count;
28796  while (1) {
28797  if (field == &ctx->root) {
28798  ctx->head = NULL;
28799  if (ctx->enc_count != 0) {
28800  __Pyx_BufFmt_RaiseExpected(ctx);
28801  return -1;
28802  }
28803  break;
28804  }
28805  ctx->head->field = ++field;
28806  if (field->type == NULL) {
28807  --ctx->head;
28808  field = ctx->head->field;
28809  continue;
28810  } else if (field->type->typegroup == 'S') {
28811  size_t parent_offset = ctx->head->parent_offset + field->offset;
28812  if (field->type->fields->type == NULL) continue;
28813  field = field->type->fields;
28814  ++ctx->head;
28815  ctx->head->field = field;
28816  ctx->head->parent_offset = parent_offset;
28817  break;
28818  } else {
28819  break;
28820  }
28821  }
28822  } while (ctx->enc_count);
28823  ctx->enc_type = 0;
28824  ctx->is_complex = 0;
28825  return 0;
28826 }
28827 static PyObject *
28828 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
28829 {
28830  const char *ts = *tsp;
28831  int i = 0, number;
28832  int ndim = ctx->head->field->type->ndim;
28833 ;
28834  ++ts;
28835  if (ctx->new_count != 1) {
28836  PyErr_SetString(PyExc_ValueError,
28837  "Cannot handle repeated arrays in format string");
28838  return NULL;
28839  }
28840  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
28841  while (*ts && *ts != ')') {
28842  switch (*ts) {
28843  case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
28844  default: break;
28845  }
28846  number = __Pyx_BufFmt_ExpectNumber(&ts);
28847  if (number == -1) return NULL;
28848  if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
28849  return PyErr_Format(PyExc_ValueError,
28850  "Expected a dimension of size %zu, got %d",
28851  ctx->head->field->type->arraysize[i], number);
28852  if (*ts != ',' && *ts != ')')
28853  return PyErr_Format(PyExc_ValueError,
28854  "Expected a comma in format string, got '%c'", *ts);
28855  if (*ts == ',') ts++;
28856  i++;
28857  }
28858  if (i != ndim)
28859  return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
28860  ctx->head->field->type->ndim, i);
28861  if (!*ts) {
28862  PyErr_SetString(PyExc_ValueError,
28863  "Unexpected end of format string, expected ')'");
28864  return NULL;
28865  }
28866  ctx->is_valid_array = 1;
28867  ctx->new_count = 1;
28868  *tsp = ++ts;
28869  return Py_None;
28870 }
28871 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
28872  int got_Z = 0;
28873  while (1) {
28874  switch(*ts) {
28875  case 0:
28876  if (ctx->enc_type != 0 && ctx->head == NULL) {
28877  __Pyx_BufFmt_RaiseExpected(ctx);
28878  return NULL;
28879  }
28880  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
28881  if (ctx->head != NULL) {
28882  __Pyx_BufFmt_RaiseExpected(ctx);
28883  return NULL;
28884  }
28885  return ts;
28886  case ' ':
28887  case '\r':
28888  case '\n':
28889  ++ts;
28890  break;
28891  case '<':
28892  if (!__Pyx_Is_Little_Endian()) {
28893  PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
28894  return NULL;
28895  }
28896  ctx->new_packmode = '=';
28897  ++ts;
28898  break;
28899  case '>':
28900  case '!':
28901  if (__Pyx_Is_Little_Endian()) {
28902  PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
28903  return NULL;
28904  }
28905  ctx->new_packmode = '=';
28906  ++ts;
28907  break;
28908  case '=':
28909  case '@':
28910  case '^':
28911  ctx->new_packmode = *ts++;
28912  break;
28913  case 'T':
28914  {
28915  const char* ts_after_sub;
28916  size_t i, struct_count = ctx->new_count;
28917  size_t struct_alignment = ctx->struct_alignment;
28918  ctx->new_count = 1;
28919  ++ts;
28920  if (*ts != '{') {
28921  PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
28922  return NULL;
28923  }
28924  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
28925  ctx->enc_type = 0;
28926  ctx->enc_count = 0;
28927  ctx->struct_alignment = 0;
28928  ++ts;
28929  ts_after_sub = ts;
28930  for (i = 0; i != struct_count; ++i) {
28931  ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
28932  if (!ts_after_sub) return NULL;
28933  }
28934  ts = ts_after_sub;
28935  if (struct_alignment) ctx->struct_alignment = struct_alignment;
28936  }
28937  break;
28938  case '}':
28939  {
28940  size_t alignment = ctx->struct_alignment;
28941  ++ts;
28942  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
28943  ctx->enc_type = 0;
28944  if (alignment && ctx->fmt_offset % alignment) {
28945  ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
28946  }
28947  }
28948  return ts;
28949  case 'x':
28950  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
28951  ctx->fmt_offset += ctx->new_count;
28952  ctx->new_count = 1;
28953  ctx->enc_count = 0;
28954  ctx->enc_type = 0;
28955  ctx->enc_packmode = ctx->new_packmode;
28956  ++ts;
28957  break;
28958  case 'Z':
28959  got_Z = 1;
28960  ++ts;
28961  if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
28962  __Pyx_BufFmt_RaiseUnexpectedChar('Z');
28963  return NULL;
28964  }
28965  CYTHON_FALLTHROUGH;
28966  case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
28967  case 'l': case 'L': case 'q': case 'Q':
28968  case 'f': case 'd': case 'g':
28969  case 'O': case 'p':
28970  if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
28971  ctx->enc_packmode == ctx->new_packmode) {
28972  ctx->enc_count += ctx->new_count;
28973  ctx->new_count = 1;
28974  got_Z = 0;
28975  ++ts;
28976  break;
28977  }
28978  CYTHON_FALLTHROUGH;
28979  case 's':
28980  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
28981  ctx->enc_count = ctx->new_count;
28982  ctx->enc_packmode = ctx->new_packmode;
28983  ctx->enc_type = *ts;
28984  ctx->is_complex = got_Z;
28985  ++ts;
28986  ctx->new_count = 1;
28987  got_Z = 0;
28988  break;
28989  case ':':
28990  ++ts;
28991  while(*ts != ':') ++ts;
28992  ++ts;
28993  break;
28994  case '(':
28995  if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
28996  break;
28997  default:
28998  {
28999  int number = __Pyx_BufFmt_ExpectNumber(&ts);
29000  if (number == -1) return NULL;
29001  ctx->new_count = (size_t)number;
29002  }
29003  }
29004  }
29005 }
29006 
29007 /* TypeInfoCompare */
29008  static int
29009 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
29010 {
29011  int i;
29012  if (!a || !b)
29013  return 0;
29014  if (a == b)
29015  return 1;
29016  if (a->size != b->size || a->typegroup != b->typegroup ||
29017  a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
29018  if (a->typegroup == 'H' || b->typegroup == 'H') {
29019  return a->size == b->size;
29020  } else {
29021  return 0;
29022  }
29023  }
29024  if (a->ndim) {
29025  for (i = 0; i < a->ndim; i++)
29026  if (a->arraysize[i] != b->arraysize[i])
29027  return 0;
29028  }
29029  if (a->typegroup == 'S') {
29030  if (a->flags != b->flags)
29031  return 0;
29032  if (a->fields || b->fields) {
29033  if (!(a->fields && b->fields))
29034  return 0;
29035  for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
29036  __Pyx_StructField *field_a = a->fields + i;
29037  __Pyx_StructField *field_b = b->fields + i;
29038  if (field_a->offset != field_b->offset ||
29039  !__pyx_typeinfo_cmp(field_a->type, field_b->type))
29040  return 0;
29041  }
29042  return !a->fields[i].type && !b->fields[i].type;
29043  }
29044  }
29045  return 1;
29046 }
29047 
29048 /* MemviewSliceValidateAndInit */
29049  static int
29050 __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
29051 {
29052  if (buf->shape[dim] <= 1)
29053  return 1;
29054  if (buf->strides) {
29055  if (spec & __Pyx_MEMVIEW_CONTIG) {
29056  if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
29057  if (buf->strides[dim] != sizeof(void *)) {
29058  PyErr_Format(PyExc_ValueError,
29059  "Buffer is not indirectly contiguous "
29060  "in dimension %d.", dim);
29061  goto fail;
29062  }
29063  } else if (buf->strides[dim] != buf->itemsize) {
29064  PyErr_SetString(PyExc_ValueError,
29065  "Buffer and memoryview are not contiguous "
29066  "in the same dimension.");
29067  goto fail;
29068  }
29069  }
29070  if (spec & __Pyx_MEMVIEW_FOLLOW) {
29071  Py_ssize_t stride = buf->strides[dim];
29072  if (stride < 0)
29073  stride = -stride;
29074  if (stride < buf->itemsize) {
29075  PyErr_SetString(PyExc_ValueError,
29076  "Buffer and memoryview are not contiguous "
29077  "in the same dimension.");
29078  goto fail;
29079  }
29080  }
29081  } else {
29082  if (spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1) {
29083  PyErr_Format(PyExc_ValueError,
29084  "C-contiguous buffer is not contiguous in "
29085  "dimension %d", dim);
29086  goto fail;
29087  } else if (spec & (__Pyx_MEMVIEW_PTR)) {
29088  PyErr_Format(PyExc_ValueError,
29089  "C-contiguous buffer is not indirect in "
29090  "dimension %d", dim);
29091  goto fail;
29092  } else if (buf->suboffsets) {
29093  PyErr_SetString(PyExc_ValueError,
29094  "Buffer exposes suboffsets but no strides");
29095  goto fail;
29096  }
29097  }
29098  return 1;
29099 fail:
29100  return 0;
29101 }
29102 static int
29103 __pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec)
29104 {
29105  if (spec & __Pyx_MEMVIEW_DIRECT) {
29106  if (buf->suboffsets && buf->suboffsets[dim] >= 0) {
29107  PyErr_Format(PyExc_ValueError,
29108  "Buffer not compatible with direct access "
29109  "in dimension %d.", dim);
29110  goto fail;
29111  }
29112  }
29113  if (spec & __Pyx_MEMVIEW_PTR) {
29114  if (!buf->suboffsets || (buf->suboffsets && buf->suboffsets[dim] < 0)) {
29115  PyErr_Format(PyExc_ValueError,
29116  "Buffer is not indirectly accessible "
29117  "in dimension %d.", dim);
29118  goto fail;
29119  }
29120  }
29121  return 1;
29122 fail:
29123  return 0;
29124 }
29125 static int
29126 __pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
29127 {
29128  int i;
29129  if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
29130  Py_ssize_t stride = 1;
29131  for (i = 0; i < ndim; i++) {
29132  if (stride * buf->itemsize != buf->strides[i] &&
29133  buf->shape[i] > 1)
29134  {
29135  PyErr_SetString(PyExc_ValueError,
29136  "Buffer not fortran contiguous.");
29137  goto fail;
29138  }
29139  stride = stride * buf->shape[i];
29140  }
29141  } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
29142  Py_ssize_t stride = 1;
29143  for (i = ndim - 1; i >- 1; i--) {
29144  if (stride * buf->itemsize != buf->strides[i] &&
29145  buf->shape[i] > 1) {
29146  PyErr_SetString(PyExc_ValueError,
29147  "Buffer not C contiguous.");
29148  goto fail;
29149  }
29150  stride = stride * buf->shape[i];
29151  }
29152  }
29153  return 1;
29154 fail:
29155  return 0;
29156 }
29157 static int __Pyx_ValidateAndInit_memviewslice(
29158  int *axes_specs,
29159  int c_or_f_flag,
29160  int buf_flags,
29161  int ndim,
29162  __Pyx_TypeInfo *dtype,
29163  __Pyx_BufFmt_StackElem stack[],
29164  __Pyx_memviewslice *memviewslice,
29165  PyObject *original_obj)
29166 {
29167  struct __pyx_memoryview_obj *memview, *new_memview;
29168  __Pyx_RefNannyDeclarations
29169  Py_buffer *buf;
29170  int i, spec = 0, retval = -1;
29171  __Pyx_BufFmt_Context ctx;
29172  int from_memoryview = __pyx_memoryview_check(original_obj);
29173  __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
29174  if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
29175  original_obj)->typeinfo)) {
29176  memview = (struct __pyx_memoryview_obj *) original_obj;
29177  new_memview = NULL;
29178  } else {
29179  memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
29180  original_obj, buf_flags, 0, dtype);
29181  new_memview = memview;
29182  if (unlikely(!memview))
29183  goto fail;
29184  }
29185  buf = &memview->view;
29186  if (buf->ndim != ndim) {
29187  PyErr_Format(PyExc_ValueError,
29188  "Buffer has wrong number of dimensions (expected %d, got %d)",
29189  ndim, buf->ndim);
29190  goto fail;
29191  }
29192  if (new_memview) {
29193  __Pyx_BufFmt_Init(&ctx, stack, dtype);
29194  if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
29195  }
29196  if ((unsigned) buf->itemsize != dtype->size) {
29197  PyErr_Format(PyExc_ValueError,
29198  "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
29199  "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
29200  buf->itemsize,
29201  (buf->itemsize > 1) ? "s" : "",
29202  dtype->name,
29203  dtype->size,
29204  (dtype->size > 1) ? "s" : "");
29205  goto fail;
29206  }
29207  for (i = 0; i < ndim; i++) {
29208  spec = axes_specs[i];
29209  if (!__pyx_check_strides(buf, i, ndim, spec))
29210  goto fail;
29211  if (!__pyx_check_suboffsets(buf, i, ndim, spec))
29212  goto fail;
29213  }
29214  if (buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag))
29215  goto fail;
29216  if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
29217  new_memview != NULL) == -1)) {
29218  goto fail;
29219  }
29220  retval = 0;
29221  goto no_fail;
29222 fail:
29223  Py_XDECREF(new_memview);
29224  retval = -1;
29225 no_fail:
29226  __Pyx_RefNannyFinishContext();
29227  return retval;
29228 }
29229 
29230 /* ObjectToMemviewSlice */
29231  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj, int writable_flag) {
29232  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
29233  __Pyx_BufFmt_StackElem stack[1];
29234  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
29235  int retcode;
29236  if (obj == Py_None) {
29237  result.memview = (struct __pyx_memoryview_obj *) Py_None;
29238  return result;
29239  }
29240  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
29241  PyBUF_RECORDS_RO | writable_flag, 1,
29242  &__Pyx_TypeInfo_double, stack,
29243  &result, obj);
29244  if (unlikely(retcode == -1))
29245  goto __pyx_fail;
29246  return result;
29247 __pyx_fail:
29248  result.memview = NULL;
29249  result.data = NULL;
29250  return result;
29251 }
29252 
29253 /* ObjectToMemviewSlice */
29254  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *obj, int writable_flag) {
29255  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
29256  __Pyx_BufFmt_StackElem stack[1];
29257  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
29258  int retcode;
29259  if (obj == Py_None) {
29260  result.memview = (struct __pyx_memoryview_obj *) Py_None;
29261  return result;
29262  }
29263  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
29264  PyBUF_RECORDS_RO | writable_flag, 1,
29265  &__Pyx_TypeInfo_int, stack,
29266  &result, obj);
29267  if (unlikely(retcode == -1))
29268  goto __pyx_fail;
29269  return result;
29270 __pyx_fail:
29271  result.memview = NULL;
29272  result.data = NULL;
29273  return result;
29274 }
29275 
29276 /* CheckBinaryVersion */
29277  static int __Pyx_check_binary_version(void) {
29278  char ctversion[4], rtversion[4];
29279  PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
29280  PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
29281  if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
29282  char message[200];
29283  PyOS_snprintf(message, sizeof(message),
29284  "compiletime version %s of module '%.100s' "
29285  "does not match runtime version %s",
29286  ctversion, __Pyx_MODULE_NAME, rtversion);
29287  return PyErr_WarnEx(NULL, message, 1);
29288  }
29289  return 0;
29290 }
29291 
29292 /* ModuleImport */
29293  #ifndef __PYX_HAVE_RT_ImportModule
29294 #define __PYX_HAVE_RT_ImportModule
29295 static PyObject *__Pyx_ImportModule(const char *name) {
29296  PyObject *py_name = 0;
29297  PyObject *py_module = 0;
29298  py_name = __Pyx_PyIdentifier_FromString(name);
29299  if (!py_name)
29300  goto bad;
29301  py_module = PyImport_Import(py_name);
29302  Py_DECREF(py_name);
29303  return py_module;
29304 bad:
29305  Py_XDECREF(py_name);
29306  return 0;
29307 }
29308 #endif
29309 
29310 /* TypeImport */
29311  #ifndef __PYX_HAVE_RT_ImportType
29312 #define __PYX_HAVE_RT_ImportType
29313 static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
29314  size_t size, int strict)
29315 {
29316  PyObject *py_module = 0;
29317  PyObject *result = 0;
29318  PyObject *py_name = 0;
29319  char warning[200];
29320  Py_ssize_t basicsize;
29321 #ifdef Py_LIMITED_API
29322  PyObject *py_basicsize;
29323 #endif
29324  py_module = __Pyx_ImportModule(module_name);
29325  if (!py_module)
29326  goto bad;
29327  py_name = __Pyx_PyIdentifier_FromString(class_name);
29328  if (!py_name)
29329  goto bad;
29330  result = PyObject_GetAttr(py_module, py_name);
29331  Py_DECREF(py_name);
29332  py_name = 0;
29333  Py_DECREF(py_module);
29334  py_module = 0;
29335  if (!result)
29336  goto bad;
29337  if (!PyType_Check(result)) {
29338  PyErr_Format(PyExc_TypeError,
29339  "%.200s.%.200s is not a type object",
29340  module_name, class_name);
29341  goto bad;
29342  }
29343 #ifndef Py_LIMITED_API
29344  basicsize = ((PyTypeObject *)result)->tp_basicsize;
29345 #else
29346  py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
29347  if (!py_basicsize)
29348  goto bad;
29349  basicsize = PyLong_AsSsize_t(py_basicsize);
29350  Py_DECREF(py_basicsize);
29351  py_basicsize = 0;
29352  if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
29353  goto bad;
29354 #endif
29355  if (!strict && (size_t)basicsize > size) {
29356  PyOS_snprintf(warning, sizeof(warning),
29357  "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd",
29358  module_name, class_name, basicsize, size);
29359  if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
29360  }
29361  else if ((size_t)basicsize != size) {
29362  PyErr_Format(PyExc_ValueError,
29363  "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd",
29364  module_name, class_name, basicsize, size);
29365  goto bad;
29366  }
29367  return (PyTypeObject *)result;
29368 bad:
29369  Py_XDECREF(py_module);
29370  Py_XDECREF(result);
29371  return NULL;
29372 }
29373 #endif
29374 
29375 /* InitStrings */
29376  static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
29377  while (t->p) {
29378  #if PY_MAJOR_VERSION < 3
29379  if (t->is_unicode) {
29380  *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
29381  } else if (t->intern) {
29382  *t->p = PyString_InternFromString(t->s);
29383  } else {
29384  *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
29385  }
29386  #else
29387  if (t->is_unicode | t->is_str) {
29388  if (t->intern) {
29389  *t->p = PyUnicode_InternFromString(t->s);
29390  } else if (t->encoding) {
29391  *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
29392  } else {
29393  *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
29394  }
29395  } else {
29396  *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
29397  }
29398  #endif
29399  if (!*t->p)
29400  return -1;
29401  if (PyObject_Hash(*t->p) == -1)
29402  return -1;
29403  ++t;
29404  }
29405  return 0;
29406 }
29407 
29408 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
29409  return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
29410 }
29411 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
29412  Py_ssize_t ignore;
29413  return __Pyx_PyObject_AsStringAndSize(o, &ignore);
29414 }
29415 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
29416 #if !CYTHON_PEP393_ENABLED
29417 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29418  char* defenc_c;
29419  PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
29420  if (!defenc) return NULL;
29421  defenc_c = PyBytes_AS_STRING(defenc);
29422 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29423  {
29424  char* end = defenc_c + PyBytes_GET_SIZE(defenc);
29425  char* c;
29426  for (c = defenc_c; c < end; c++) {
29427  if ((unsigned char) (*c) >= 128) {
29428  PyUnicode_AsASCIIString(o);
29429  return NULL;
29430  }
29431  }
29432  }
29433 #endif
29434  *length = PyBytes_GET_SIZE(defenc);
29435  return defenc_c;
29436 }
29437 #else
29438 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29439  if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
29440 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29441  if (likely(PyUnicode_IS_ASCII(o))) {
29442  *length = PyUnicode_GET_LENGTH(o);
29443  return PyUnicode_AsUTF8(o);
29444  } else {
29445  PyUnicode_AsASCIIString(o);
29446  return NULL;
29447  }
29448 #else
29449  return PyUnicode_AsUTF8AndSize(o, length);
29450 #endif
29451 }
29452 #endif
29453 #endif
29454 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29455 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
29456  if (
29457 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29458  __Pyx_sys_getdefaultencoding_not_ascii &&
29459 #endif
29460  PyUnicode_Check(o)) {
29461  return __Pyx_PyUnicode_AsStringAndSize(o, length);
29462  } else
29463 #endif
29464 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
29465  if (PyByteArray_Check(o)) {
29466  *length = PyByteArray_GET_SIZE(o);
29467  return PyByteArray_AS_STRING(o);
29468  } else
29469 #endif
29470  {
29471  char* result;
29472  int r = PyBytes_AsStringAndSize(o, &result, length);
29473  if (unlikely(r < 0)) {
29474  return NULL;
29475  } else {
29476  return result;
29477  }
29478  }
29479 }
29480 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
29481  int is_true = x == Py_True;
29482  if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
29483  else return PyObject_IsTrue(x);
29484 }
29485 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
29486 #if PY_MAJOR_VERSION >= 3
29487  if (PyLong_Check(result)) {
29488  if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
29489  "__int__ returned non-int (type %.200s). "
29490  "The ability to return an instance of a strict subclass of int "
29491  "is deprecated, and may be removed in a future version of Python.",
29492  Py_TYPE(result)->tp_name)) {
29493  Py_DECREF(result);
29494  return NULL;
29495  }
29496  return result;
29497  }
29498 #endif
29499  PyErr_Format(PyExc_TypeError,
29500  "__%.4s__ returned non-%.4s (type %.200s)",
29501  type_name, type_name, Py_TYPE(result)->tp_name);
29502  Py_DECREF(result);
29503  return NULL;
29504 }
29505 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
29506 #if CYTHON_USE_TYPE_SLOTS
29507  PyNumberMethods *m;
29508 #endif
29509  const char *name = NULL;
29510  PyObject *res = NULL;
29511 #if PY_MAJOR_VERSION < 3
29512  if (likely(PyInt_Check(x) || PyLong_Check(x)))
29513 #else
29514  if (likely(PyLong_Check(x)))
29515 #endif
29516  return __Pyx_NewRef(x);
29517 #if CYTHON_USE_TYPE_SLOTS
29518  m = Py_TYPE(x)->tp_as_number;
29519  #if PY_MAJOR_VERSION < 3
29520  if (m && m->nb_int) {
29521  name = "int";
29522  res = m->nb_int(x);
29523  }
29524  else if (m && m->nb_long) {
29525  name = "long";
29526  res = m->nb_long(x);
29527  }
29528  #else
29529  if (likely(m && m->nb_int)) {
29530  name = "int";
29531  res = m->nb_int(x);
29532  }
29533  #endif
29534 #else
29535  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
29536  res = PyNumber_Int(x);
29537  }
29538 #endif
29539  if (likely(res)) {
29540 #if PY_MAJOR_VERSION < 3
29541  if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
29542 #else
29543  if (unlikely(!PyLong_CheckExact(res))) {
29544 #endif
29545  return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
29546  }
29547  }
29548  else if (!PyErr_Occurred()) {
29549  PyErr_SetString(PyExc_TypeError,
29550  "an integer is required");
29551  }
29552  return res;
29553 }
29554 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
29555  Py_ssize_t ival;
29556  PyObject *x;
29557 #if PY_MAJOR_VERSION < 3
29558  if (likely(PyInt_CheckExact(b))) {
29559  if (sizeof(Py_ssize_t) >= sizeof(long))
29560  return PyInt_AS_LONG(b);
29561  else
29562  return PyInt_AsSsize_t(x);
29563  }
29564 #endif
29565  if (likely(PyLong_CheckExact(b))) {
29566  #if CYTHON_USE_PYLONG_INTERNALS
29567  const digit* digits = ((PyLongObject*)b)->ob_digit;
29568  const Py_ssize_t size = Py_SIZE(b);
29569  if (likely(__Pyx_sst_abs(size) <= 1)) {
29570  ival = likely(size) ? digits[0] : 0;
29571  if (size == -1) ival = -ival;
29572  return ival;
29573  } else {
29574  switch (size) {
29575  case 2:
29576  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
29577  return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29578  }
29579  break;
29580  case -2:
29581  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
29582  return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29583  }
29584  break;
29585  case 3:
29586  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
29587  return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29588  }
29589  break;
29590  case -3:
29591  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
29592  return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29593  }
29594  break;
29595  case 4:
29596  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
29597  return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29598  }
29599  break;
29600  case -4:
29601  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
29602  return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29603  }
29604  break;
29605  }
29606  }
29607  #endif
29608  return PyLong_AsSsize_t(b);
29609  }
29610  x = PyNumber_Index(b);
29611  if (!x) return -1;
29612  ival = PyInt_AsSsize_t(x);
29613  Py_DECREF(x);
29614  return ival;
29615 }
29616 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
29617  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
29618 }
29619 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
29620  return PyInt_FromSize_t(ival);
29621 }
29622 
29623 
29624 #endif /* Py_PYTHON_H */
asm_NR_prepare
void asm_NR_prepare(SuperMatrix *A, int *subdomain_dim, int **l2g_L, double **subdomainL, PROTEUS_LAPACK_INTEGER **subdomainPivots)
Definition: smoothers.c:293
jacobi_NR_prepare
void jacobi_NR_prepare(SuperMatrix *A, double w, double tol, double *M)
Definition: smoothers.c:10
basm_NR_prepare
void basm_NR_prepare(int rowBlocks, int N, SuperMatrix *A, int *subdomain_dim, int **l2g_L, double **subdomainL, PROTEUS_LAPACK_INTEGER **subdomainPivots, PROTEUS_LAPACK_INTEGER **subdomainColPivots)
Definition: smoothers.c:602
smoothers.h
C implementations of multilevel smoother algorithms.
jacobi_NR_solve
void jacobi_NR_solve(SuperMatrix *A, double *M, double *R, int *node_order, double *dX)
Definition: smoothers.c:15
gauss_seidel_NR_prepare
void gauss_seidel_NR_prepare(SuperMatrix *A, double w, double tol, double *M)
Definition: smoothers.c:71
f
Double f
Definition: Headers.h:64
number
Int number
Definition: Headers.h:33
asm_NR_free
void asm_NR_free(int N, int *subdomain_dim, int **l2g_L, double **subdomain_L, double **subdomain_R, double **subdomain_dX, PROTEUS_LAPACK_INTEGER **subdomain_pivots)
Definition: smoothers.c:268
s
Double s
Definition: Headers.h:84
L
Double L
Definition: Headers.h:72
n
Int n
Definition: Headers.h:28
q
Double q
Definition: Headers.h:81
basm_NR_init
int basm_NR_init(int rowBlocks, SuperMatrix *A, int **subdomain_dim_p, int ***l2g_L_p, double ***subdomain_L_p, double ***subdomain_R_p, double ***subdomain_dX_p, PROTEUS_LAPACK_INTEGER ***subdomain_pivots_p, PROTEUS_LAPACK_INTEGER ***subdomain_col_pivots_p)
Definition: smoothers.c:391
asm_NR_init
int asm_NR_init(SuperMatrix *A, int **subdomain_dim_p, int ***l2g_L_p, double ***subdomain_L_p, double ***subdomain_R_p, double ***subdomain_dX_p, PROTEUS_LAPACK_INTEGER ***subdomain_pivots_p)
Definition: smoothers.c:189
v
Double v
Definition: Headers.h:95
T
Double T
Definition: Headers.h:87
z
Double * z
Definition: Headers.h:49
u
Double u
Definition: Headers.h:89
ns
Int ns
Definition: Headers.h:30
c
Double c
Definition: Headers.h:54
asm_NR_solve
void asm_NR_solve(SuperMatrix *A, double w, double **subdomainL, int *subdomain_dim, int **l2g_L, double *R, double **subdomainR, int *node_order, double **subdomain_dX, double *dX, PROTEUS_LAPACK_INTEGER **subdomainPivots)
Definition: smoothers.c:324
basm_NR_free
void basm_NR_free(int N, int *subdomain_dim, int **l2g_L, double **subdomain_L, double **subdomain_R, double **subdomain_dX, PROTEUS_LAPACK_INTEGER **subdomain_pivots, PROTEUS_LAPACK_INTEGER **subdomain_col_pivots)
Definition: smoothers.c:574
proteus_superlu.h
nl_gauss_seidel_NR_solve
void nl_gauss_seidel_NR_solve(SuperMatrix *A, double *R, int *node_order, double w, double tol, double *dX)
Definition: smoothers.c:142
nl_jacobi_NR_solve
void nl_jacobi_NR_solve(SuperMatrix *A, double *R, int *node_order, double w, double tol, double *dX)
Definition: smoothers.c:26
r
Double r
Definition: Headers.h:83
pos
double pos(double a)
Definition: testFMMandFSW.cpp:8
gauss_seidel_NR_solve
void gauss_seidel_NR_solve(SuperMatrix *A, double *M, double *R, int *node_order, double *dX)
Definition: smoothers.c:114
basm_NR_solve
void basm_NR_solve(int rowBlocks, int N, SuperMatrix *A, double w, double **subdomainL, int *subdomain_dim, int **l2g_L, double *R, double **subdomainR, int *node_order, double **subdomain_dX, double *dX, PROTEUS_LAPACK_INTEGER **subdomainPivots, PROTEUS_LAPACK_INTEGER **subdomainColPivots)
Definition: smoothers.c:668
nnz
#define nnz
Definition: Richards.h:7